Two Laptop Bag*
The moose likes JDBC and the fly likes Finding primary key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Finding primary key" Watch "Finding primary key" New topic
Author

Finding primary key

Shashikanth Ravulapelli
Greenhorn

Joined: May 09, 2001
Posts: 1
Is there any way to find out Primary key from a resultset. I looked in ResultSetMetaData and ResultSet interfaces, and couldn't find any. My problem is to copy a row in one of the table, which has a primary key. During insertion time, you cannot specify a value for Primary key column and i would like to skip the value in the result set which is a value for the primary key.


shashi
Yogen Vadnere
Ranch Hand

Joined: Sep 20, 2001
Posts: 58
Hello,
DatabaseMetaData has two methods
getPrimaryKeys(String catalog, String schema, String table)
Hope this will work for u..

Yogen Vadnere
 
jQuery in Action, 2nd edition
 
subject: Finding primary key