From caadbecf79681ab06b1fd68e552e80b891eb36aa Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Thu, 20 Oct 2011 17:58:00 +0000 Subject: [PATCH] [#881] Re-design H2 stored functions to be pre-compiled, in order to speed up integration tests --- jOOQ-test/src/org/jooq/test/h2/F.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jOOQ-test/src/org/jooq/test/h2/F.java b/jOOQ-test/src/org/jooq/test/h2/F.java index 9fab479650..f79ebf28a2 100644 --- a/jOOQ-test/src/org/jooq/test/h2/F.java +++ b/jOOQ-test/src/org/jooq/test/h2/F.java @@ -74,6 +74,8 @@ public class F { public static ResultSet fGetOneCursor(Connection connection, Object[] bookIds) throws SQLException { PreparedStatement stmt = null; + if (bookIds == null) bookIds = new Object[0]; + String sql = create(connection) .select() .from(T_BOOK) @@ -82,6 +84,11 @@ public class F { .getSQL(); stmt = connection.prepareStatement(sql); + int i = 1; + for (Object o : bookIds) { + stmt.setObject(i++, o); + } + return stmt.executeQuery(); }