This content has been marked as final. Show 4 replies
The unsupported feature will be in the SQL which you haven't shown us, or maybe it isn't an INSERT statement so asking for generated keys is futile.
The SQL which I'm using is this...
INSERT INTO DMS (dms_identifier, dms_location, beacon, roadway_number, direction_code, center_id) VALUES (?,?,?,?,?,?)
Don't think it would be causing a problem...
I am connecting to an 184.108.40.206 Oracle database and am using ojdbc6.jar (11.2 drivers I believe). Yet I continue to receive an SQLException with message (Unsupported Feature).
Any ideas what is wrong? Has this feature been removed in the OJDBC drivers?
No - Statement.RETURN_GENERATED_KEYS support has not been removed. It was never supported to begin with.
See 'Retrieval of Auto_Generated Keys in the JDBC Dev guide for how, and when, to use the generated key functionality.
If key columns are not explicitly indicated, then Oracle JDBC drivers cannot identify which columns need to be retrieved. When a column name or column index array is used, Oracle JDBC drivers can identify which columns contain auto-generated keys that you want to retrieve. However, when the Statement.RETURN_GENERATED_KEYS integer flag is used, Oracle JDBC drivers cannot identify these columns. When the integer flag is used to indicate that auto-generated keys are to be returned, the ROWID pseudo column is returned as key. The ROWID can be then fetched from the ResultSet object and can be used to retrieve other columns.
The following code illustrates retrieval of auto-generated keys:
. . .
Did you notice this statement: when the Statement.RETURN_GENERATED_KEYS integer flag is used, Oracle JDBC drivers cannot identify these columns?
That citation is followed by an example of how to retrieve auto-generated keys.
This seems to have corrected the issue. Thanks for your help!