aspose file tools*
The moose likes JDBC and the fly likes Oracle JDBC, auto generated keys, JDBC 3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Oracle JDBC, auto generated keys, JDBC 3.0" Watch "Oracle JDBC, auto generated keys, JDBC 3.0" New topic
Author

Oracle JDBC, auto generated keys, JDBC 3.0

Sean Sullivan
Ranch Hand

Joined: Sep 09, 2001
Posts: 427
Is anybody using Oracle9i and JDBC's API for auto generated keys?
Please share details with the rest of us!
http://java.sun.com/products/jdbc/
JDBC 3.0 specification
Section 13.6
Retrieving Auto Generated Keys
"Many database systems have a mechanism that automatically generates a
unique
key field when a row is inserted. The method Statement.getGeneratedKeys,
which can be called to retrieve the value of such a key, returns a ResultSet
object
with a column for each automatically generated key. A flag indicating that
any auto
generated columns should be returned is passed to the methods execute,
executeUpdate or prepareStatement when the statement is executed or
prepared. [...]"
Details:
java.sql.Statement.RETURN_GENERATED_KEYS
java.sql.Statement.getGeneratedKeys()

This article discusses autogenerated keys:
http://www-106.ibm.com/developerworks/java/library/j-jdbcnew/
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1125

Hi Sean,
I see you got a reply to this same question that you posted on the OTN forums.
Perhaps you would care to share with us that

Oracle JDBC drivers currenly don't support "Retrieving Auto Generated Keys" , may be we can expect it by 10i or later.

Cheers,
Avi.
 
 
subject: Oracle JDBC, auto generated keys, JDBC 3.0