File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to display primary keys from metadata

 
waleed atef abdel elazyz
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic