To check if a column is auto incremented i can do the following
Connection con = ...
DatabaseMetaData meta = con.getMetaData();
ResultSet metaCols = meta.getColumns(catalog, schema, table, "%");
while ( metaCols.next() )
String value = rs.getString("IS_AUTOINCREMENT")
...
works fine except with Sybase databases. I've tried it with the jTDS and JConnect drivers, but with both drivers I get the this exception:
java.sql.SQLException: Invalid column name IS_AUTOINCREMENT.
Is there another the get find out, whether a column in Sybase is auto incremented or not? I thought "IS_AUTOINCREMENT" is a feature with JDBC4 and jTDS is a JDBC4 compatible driver.