This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes error with auto-generated keys Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "error with auto-generated keys" Watch "error with auto-generated keys" New topic

error with auto-generated keys

Vinay Belagavi

Joined: Jun 15, 2006
Posts: 29
Hi when I am using the auto-generated keys in my code I am getting the following error. Can someone tell me why I am getting this error. I have also set the drivers for oracle.I am using jdk1.6, eclipse as the IDE and Oracle10g R2

The exception I am getting is

java.sql.SQLException: Invalid column type: getInt not implemented for class oracle.jdbc.driver.T4CRowidAccessor
at oracle.jdbc.driver.DatabaseError.throwSqlException(
at oracle.jdbc.driver.DatabaseError.throwSqlException(
at oracle.jdbc.driver.Accessor.unimpl(
at oracle.jdbc.driver.Accessor.getInt(
at oracle.jdbc.driver.OracleReturnResultSet.getInt(
at AutoGenerationKeys.AutoGenKeys.main(

Also when I am running the program which has ParameterMetaData Class i get an exception saying Unsupported feature. Why am I getting this?

Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Hi John,

Oracle does not have mysql like auto increment primary keys, you provide this using sequences in your insert statements.
But I suppose when you request generated keys with this

statement returns you rowid, which may be considered some sort of generated key and may be used to address the row in a table.

java.sql.SQLException: Invalid column type: getInt not implemented for class oracle.jdbc.driver.T4CRowidAccessor

This exception shows that on a rowid column no getInt method is implemented, since rowid is

ROWID is what is referred to a pseudo-column. It is not data in the database or table so much as it is a mapping of the location, in a specific datafile of the physical location of a row of data. Since rows can migrate from location-to-location when they are updated ROWID should never be stored an never be counted on to be the same in any database.
(from psoug)

You may try to use getString method on rowid. But you should really go after sequences.


I agree. Here's the link:
subject: error with auto-generated keys
It's not a secret anymore!