The typical ignition method of getting the generated id by adding getKey=1 to the runPrepQuery call throws a java exception indicating that getInt() is not supported. I modified the driver config to add support for getKey, but it didn't silence the exception. From what I can tell, if I were writing the Java JDBC code myself, I could accomplish getting the id with the following code:
PreparedStatement prepareStatement = connection.prepareStatement("insert...",
new String[] { "your_primary_key_column_name" });
prepareStatement.executeUpdate();
ResultSet generatedKeys = prepareStatement.getGeneratedKeys();
if (null != generatedKeys && generatedKeys.next()) {
Long primaryKey = generatedKeys.getLong(1);
}
Of course, I can completely roll my own java code to accomplish this myself, or maybe write a stored procedure (though I personally loathe putting code into the database, but get it that oracle is using a trigger and a sequence to accomplish this otherwise). Does anyone have any experience with this issue?