| Author |
getPrimaryKeys() method of DatabaseMetaData
|
sandeep kulkarni
Ranch Hand
Joined: Feb 25, 2004
Posts: 36
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26192
|
|
Sandeep, I have no clue, but could you post the database and driver you are using? That might spark an idea for somebody.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26192
|
|
|
Also, does it do that for all tables or just one?
|
 |
Julian Kennedy
Ranch Hand
Joined: Aug 02, 2004
Posts: 823
|
|
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
Joined: Feb 25, 2004
Posts: 36
|
|
perfect Julian.... the problem is now solved. thanks for ur comments
|
 |
 |
|
|
subject: getPrimaryKeys() method of DatabaseMetaData
|
|
|