diff --git a/querymapper/src/main/java/com/moparisthebest/jdbc/QueryMapper.java b/querymapper/src/main/java/com/moparisthebest/jdbc/QueryMapper.java index 5b99900..4fdae0d 100644 --- a/querymapper/src/main/java/com/moparisthebest/jdbc/QueryMapper.java +++ b/querymapper/src/main/java/com/moparisthebest/jdbc/QueryMapper.java @@ -333,7 +333,7 @@ public class QueryMapper implements JdbcMapper { public Long insertGetGeneratedKey(final String sql, final Object... bindObjects) throws SQLException { PreparedStatement ps = null; try { - ps = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); + ps = conn.prepareStatement(sql, new int[]{1}); // todo: create this array private static final return this.insertGetGeneratedKey(ps, bindObjects); } finally { tryClose(ps); diff --git a/test/src/test/java/com/moparisthebest/jdbc/QueryMapperTest.java b/test/src/test/java/com/moparisthebest/jdbc/QueryMapperTest.java index 6ea04fb..ca9acbe 100644 --- a/test/src/test/java/com/moparisthebest/jdbc/QueryMapperTest.java +++ b/test/src/test/java/com/moparisthebest/jdbc/QueryMapperTest.java @@ -492,7 +492,7 @@ public class QueryMapperTest { ")"); } else if (isWrapperFor(qm.getConnection(), oracleConnection)) { qm.executeUpdate("CREATE TABLE a_thaoeu_table(\n" + - " a_thaoeu_table_no INTEGER PRIMARY KEY,\n" + + " a_thaoeu_table_no NUMBER PRIMARY KEY,\n" + " a_thaoeu_table_val NUMERIC\n" + ")"); qm.executeUpdate("CREATE SEQUENCE a_thaoeu_table_seq\n" +