how to get table structre of a database in java?

adnan picture adnan · Dec 15, 2010 · Viewed 8.4k times · Source

how to get table structre of a database in java?

Answer

jmj picture jmj · Dec 15, 2010

Use DatabaseMetaData to get the table information.

You can use the getTablexxx() and getColumnxx() methods to get the table information.

Connection conn = DriverManager.getConnection(.....);
DatabaseMetaData dbmd = conn.getMetaData();
dbmd.getxxxx();