Menu

#143 isAutoIncrement() always returns false

open
nobody
None
5
2012-04-14
2012-04-14
Jira Trac
No

If you have a table like CREATE TABLE orders ( o_id INTEGER AUTO_INCREMENT NOT NULL, o_no VARCHAR(200) NOT NULL, dt_id CHARACTER(1) NOT NULL, dt_price_at_date NUMERIC(10,2) NOT NULL, u_id INTEGER NOT NULL, o_date DATE NOT NULL, PRIMARY KEY (o_id), UNIQUE (o_no) );

And use the code attached, the ResultSetMetaData isAutoIncrement() method always returns false. I have checked in CUBRID Manager and auto-increment checkbox is checked for the table.
ResultSet rs = stmt.executeQuery(SELECT * FROM orders);
ResultSetMetaData rsmd = rs.getMetaData();
String columnName = rsmd.getColumnName(1);
boolean b = rsmd.isAutoIncrement(1);

System.out.println(columnName+ +b+ );

Returns: o_id false

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.