diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java index 5356a01a8..17202786e 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java @@ -242,8 +242,11 @@ public class SQLStoreQuery PreparedStatement stmnt = null; try { - stmnt = prepareCall(conn, buf); - + if (_call) + stmnt = prepareCall(conn, buf); + else + stmnt = prepareStatement(conn, buf); + buf.setParameters(paramList); if (stmnt != null) buf.setParameters(stmnt);