public List getPrimaryKeysForTable(String tableName) throws SQLException { DatabaseMetaData dbmd = connection.getMetaData(); List pk = new Vector(); ResultSet parts = null; try { parts = dbmd.getPrimaryKeys(catalog, schema, tableName); } catch (SQLException e) { log.trace("database does not support getPrimaryKeys()", e); } if (parts != null) { try{ while (parts.next()) { pk.add(parts.getString(4)); } } finally { if (parts != null) { parts.close(); }
public List getPrimaryKeysForTable(String tableName) throws SQLException { List      pks   = new ArrayList(); ResultSet pkData = null;  try { pkData = connection.getMetaData().getPrimaryKeys(catalog, schema, tableName); while (pkData.next()) { pks.add(pkData.getString("COLUMN_NAME"));
    public List getPrimaryKeysForTable(String tableName) throws SQLException {        DatabaseMetaData dbmd = connection.getMetaData();        List pk = new Vector();        ResultSet parts = null;        try {            parts = dbmd.getPrimaryKeys(catalog, schema, tableName);        }        catch (SQLException e) {            log.trace("database does not support getPrimaryKeys()", e);        }        if (parts != null) {            try{                while (parts.next()) {                    pk.add(parts.getString(4));                }            }            finally {                if (parts != null) {                    parts.close();                }            }        }        return pk;    }