This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates 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.