Retrieving generated keys
- From: "garfield13" <garfield13@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 7 Apr 2005 07:09:03 -0700
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.
.
- Follow-Ups:
- Re: Retrieving generated keys
- From: Jimbo
- Re: Retrieving generated keys
- From: Alin Sinpalean
- Re: Retrieving generated keys
- Prev by Date: Re: JDBC SP3 and SSL
- Next by Date: Re: Error Installing JDBC SP3 on Windows 2003
- Previous by thread: Error with BigDecimal used as stored procedure parameter
- Next by thread: Re: Retrieving generated keys
- Index(es):
Relevant Pages
|
Loading