Retrieving generated keys



I have the following scenario:

MyTable
id number entity(1, 1)
name nvarchar

sniplet of Java code:
String sql = "Insert Into MyTable (name) Values( 'MyName' )";
int updateCnt = stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS);
ResultSet rs = stmt.getGeneratedKeys();

The executeUpdate() method throws an java.lang.AbstractMethodError exception.

How do I get the value of "id" after running my insert statement?

The microsoft example goes through a lot of object instantiation with
prepared calls and all that I don't necessarily want to complicate the
previous code by doing all that. But if I do, could someone please help me
with the conversion? I always use the above approach.

Thanks.
.



Relevant Pages


Loading