• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getPrimaryKeys() method of DatabaseMetaData

 
sandeep kulkarni
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm facing very strange problem.
when I use the method getPrimaryKeys() for getting the list of primary keys of table.It is returing each value twice.(if there is only one key,it is returing the same key twice).
can anybody tell what might be the reason?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34860
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandeep,
I have no clue, but could you post the database and driver you are using? That might spark an idea for somebody.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34860
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, does it do that for all tables or just one?
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandeep,

Are you specifying anything for the schema and/or catalog parameters? It seems to me that if you have two schemas in your DB that contain the same table and PK, then a call to getPrimaryKeys() with an empty or null schema parameter would give you the same information twice.

Does that help shed any light on it?

Jules
 
sandeep kulkarni
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perfect Julian....
the problem is now solved.
thanks for ur comments
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic