wood burning stoves 2.0*
The moose likes JDBC and the fly likes how to display primary keys from metadata Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to display primary keys from metadata" Watch "how to display primary keys from metadata" New topic
Author

how to display primary keys from metadata

waleed atef abdel elazyz
Greenhorn

Joined: Nov 01, 2004
Posts: 13
Dear all,
I have problem how to display and get primary keys from

databasemetadata .but already used method getprimarykeys()from

databasemetadata but the result dont understand.

note:
I want name acolumn(primary key)from the table



thanks,Best regards
[ December 14, 2004: Message edited by: waleed atef abdel elazyz ]
jeroen riezebeek
Greenhorn

Joined: Nov 26, 2002
Posts: 9
Hi,
to get the primary keys directly from the databasemetadata is not possible.
You can get the primary key with the method getPrimaryKeys(String catalog, String schema, String table).
This method returns a resultset witht primary keys.
Since there isn't a primary key object will the resultset exists of primary key names.
For more information see javadoc about the DatabaseMateData object.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to display primary keys from metadata