my dog learned polymorphism
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "Oracle JDBC, auto generated keys, JDBC 3.0" Watch "Oracle JDBC, auto generated keys, JDBC 3.0" New topic

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!
JDBC 3.0 specification
Section 13.6
Retrieving Auto Generated Keys
"Many database systems have a mechanism that automatically generates a
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
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. [...]"

This article discusses autogenerated keys:
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1141

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.

I agree. Here's the link:
subject: Oracle JDBC, auto generated keys, JDBC 3.0
It's not a secret anymore!