Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting AUTO_INCREMENT info from DatabaseMetaData

843854Jan 17 2002 — edited Jan 31 2003
Hi all,

I am experimenting with DatabaseMetaData on a MySQL database. Does anyone know how to get the information that a column of a table is autoincremented.
The DatabaseMetaData.getColumns(...) method does not seem to return this info.

Suppose a table created by
CREATE TABLE book
(book_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255))

The DatabaseMetaData returns all information of this table except that book_id is AUTO_INCREMENT.
Or am I missing something?

cu
Achim
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2003
Added on Jan 17 2002
5 comments
468 views