This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getPrimaryKeys() method of DatabaseMetaData

 
sandeep kulkarni
Ranch Hand
Posts: 36
  • 0
  • 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: 33696
316
Eclipse IDE Java VI Editor
  • 0
  • 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: 33696
316
Eclipse IDE Java VI Editor
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perfect Julian....
the problem is now solved.
thanks for ur comments
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic