提交 dd961ff8 authored 作者: Thomas Mueller's avatar Thomas Mueller

FindBugs doesn't like it, but it must be like this.

上级 c2f674d5
...@@ -11,6 +11,7 @@ import java.sql.Connection; ...@@ -11,6 +11,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
...@@ -162,7 +163,10 @@ public class Db { ...@@ -162,7 +163,10 @@ public class Db {
*/ */
public int executeUpdate(String sql) { public int executeUpdate(String sql) {
try { try {
return conn.createStatement().executeUpdate(sql); Statement stat = conn.createStatement();
int updateCount = stat.executeUpdate(sql);
stat.close();
return updateCount;
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
......
...@@ -16,6 +16,7 @@ import org.h2.jaqu.util.Utils; ...@@ -16,6 +16,7 @@ import org.h2.jaqu.util.Utils;
public class Function implements Token { public class Function implements Token {
//## Java 1.5 begin ## //## Java 1.5 begin ##
// it must be a new instance
private static final Long COUNT_STAR = new Long(0); private static final Long COUNT_STAR = new Long(0);
protected Object[] x; protected Object[] x;
......
...@@ -51,6 +51,7 @@ public class Utils { ...@@ -51,6 +51,7 @@ public class Utils {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> T newObject(Class<T> clazz) { public static <T> T newObject(Class<T> clazz) {
// must create new instances
if (clazz == Integer.class) { if (clazz == Integer.class) {
return (T) new Integer((int) counter++); return (T) new Integer((int) counter++);
} else if (clazz == String.class) { } else if (clazz == String.class) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论