This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.