I am trying to fetch Foregin key in a table using this code
DatabaseMetaData dbm=conn.getMetaData();
List options=new ArrayList();
esultSet rslt=null;
rslt=dbm.getExportedKeys(null, schema, tableName);
while(rslt.next()){
options.add(rslt.getString("FKCOLUMN_NAME"));
}
My doubt is some time I am getting same column name of this table twice or thrice or many times in the resultset? Why so?
How can I find that this particular column in resultset is related to which table primary key?
Because that column appears in more than one foreign key?