I need to allow a user to perform joins on primary/foreign key pairs. Is there anyway I can find a foreign key in a table and it's matching primary key table? I really need the columns from both the tables aswell. Is there an easy way to do this?
DatabaseMetaData.getCrossReference should do the trick for you. If your driver does not implement this method then you might have to hit the database system tables to get the info which are database specific. also DatabaseMetaData.getImportedKeys() and DatabaseMetaData.getExportedKeys() could be useful too. Jamie