Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Finding primary key

 
Shashikanth Ravulapelli
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Yogen Vadnere
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
DatabaseMetaData has two methods
getPrimaryKeys(String catalog, String schema, String table)
Hope this will work for u..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic