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

Tests

上级 f68c56be
...@@ -34,7 +34,7 @@ public class PlanItem { ...@@ -34,7 +34,7 @@ public class PlanItem {
PlanItem getJoinPlan() { PlanItem getJoinPlan() {
return joinPlan; return joinPlan;
} }
PlanItem getNestedJoinPlan() { PlanItem getNestedJoinPlan() {
return nestedJoinPlan; return nestedJoinPlan;
} }
......
...@@ -22,10 +22,10 @@ public class CachedPreparedStatements { ...@@ -22,10 +22,10 @@ public class CachedPreparedStatements {
private Connection conn; private Connection conn;
private Statement stat; private Statement stat;
private Map<String, PreparedStatement> prepared = private Map<String, PreparedStatement> prepared =
Collections.synchronizedMap( Collections.synchronizedMap(
new HashMap<String, PreparedStatement>()); new HashMap<String, PreparedStatement>());
/** /**
* This method is called when executing this sample application from the * This method is called when executing this sample application from the
* command line. * command line.
...@@ -48,10 +48,10 @@ public class CachedPreparedStatements { ...@@ -48,10 +48,10 @@ public class CachedPreparedStatements {
prep.setInt(1, 1); prep.setInt(1, 1);
prep.setString(2, "Hello"); prep.setString(2, "Hello");
prep.execute(); prep.execute();
conn.close(); conn.close();
} }
private PreparedStatement prepare(String sql) private PreparedStatement prepare(String sql)
throws SQLException { throws SQLException {
PreparedStatement prep = prepared.get(sql); PreparedStatement prep = prepared.get(sql);
if (prep == null) { if (prep == null) {
......
...@@ -52,7 +52,7 @@ public class TestSampleApps extends TestBase { ...@@ -52,7 +52,7 @@ public class TestSampleApps extends TestBase {
+ "PHONE: +41976543210\n", + "PHONE: +41976543210\n",
org.h2.samples.CsvSample.class); org.h2.samples.CsvSample.class);
testApp("", testApp("",
org.h2.samples.CachedPreparedStatements.class); org.h2.samples.CachedPreparedStatements.class);
testApp("2 is prime\n3 is prime\n5 is prime\n7 is prime\n11 is prime\n13 is prime\n17 is prime\n19 is prime\n30\n20\n0/0\n0/1\n1/0\n1/1", testApp("2 is prime\n3 is prime\n5 is prime\n7 is prime\n11 is prime\n13 is prime\n17 is prime\n19 is prime\n30\n20\n0/0\n0/1\n1/0\n1/1",
org.h2.samples.Function.class); org.h2.samples.Function.class);
// Not compatible with PostgreSQL JDBC driver (throws a NullPointerException) // Not compatible with PostgreSQL JDBC driver (throws a NullPointerException)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论