Die Metadaten können direkt erfragt werden. Quelle: https://svn.apache.org/repos/asf/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/DatabaseMetaDataWrapper.java.
/**
* Convenience method to return the foreign key meta data using the configured catalog and
* schema pattern.
*
* @param tableNamePattern The pattern identifying for which tables to return info
* @return The foreign key meta data
* @throws SQLException If an error occurred retrieving the meta data
* @see DatabaseMetaData#getImportedKeys(java.lang.String, java.lang.String, java.lang.String)
*/
public ResultSet getForeignKeys(String tableNamePattern) throws SQLException
{
return getMetaData().getImportedKeys(getCatalog(), getSchemaPattern(), tableNamePattern);
}
Dahinter steckt also http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getImportedKeys(java.lang.String,%20java.lang.String,%20java.lang.String)
__________________