Attempt to fix testGetGeneratedKeysSingleLong for oracle

This commit is contained in:
Travis Burtrum 2018-09-24 00:51:18 -04:00
parent 268b0500f1
commit 1003819064
2 changed files with 2 additions and 2 deletions

View File

@ -333,7 +333,7 @@ public class QueryMapper implements JdbcMapper {
public Long insertGetGeneratedKey(final String sql, final Object... bindObjects) throws SQLException { public Long insertGetGeneratedKey(final String sql, final Object... bindObjects) throws SQLException {
PreparedStatement ps = null; PreparedStatement ps = null;
try { 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); return this.insertGetGeneratedKey(ps, bindObjects);
} finally { } finally {
tryClose(ps); tryClose(ps);

View File

@ -492,7 +492,7 @@ public class QueryMapperTest {
")"); ")");
} else if (isWrapperFor(qm.getConnection(), oracleConnection)) { } else if (isWrapperFor(qm.getConnection(), oracleConnection)) {
qm.executeUpdate("CREATE TABLE a_thaoeu_table(\n" + 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" + " a_thaoeu_table_val NUMERIC\n" +
")"); ")");
qm.executeUpdate("CREATE SEQUENCE a_thaoeu_table_seq\n" + qm.executeUpdate("CREATE SEQUENCE a_thaoeu_table_seq\n" +