I'm trying to dynamically get the parent table names and foreign key column names of a database. However, when I try to use getExportedKeys() it returns an empty ResultSet.
I have read on another thread that this may be a known bug. The thread recommends upgrading the mysql connector to the latest version. I have upgraded to the latest alpha mysql-connector-java-6.0-nightly-20101119-bin.jar for Mac OS X but the issue still remains.
I have created a simple table using a .sql script. I am using MySQL.
I am using the following to extract the results from the database.
I am able to retrieve primary keys calling getPrimaryKeys() just fine. However, calling getExportedKeys() always returns a ResultSet that is empty. What might I be doing incorrectly? Thank you for reading this!
Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened. Happiness never decreases by being shared.
Are you sure the MySQL driver supports this? Not all databases support advanced driver features. For example, the ResultSet method getGeneratedKeys() is only support by some drivers. Alternatively, some databases, MySQL I believe is one of them, maintains a set of "system database tables" about "user database tables". You can often query them for the information you need, but they are usually quite database specific in structure.