This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Foreign keys of a particular Table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Foreign keys of a particular Table" Watch "Foreign keys of a particular Table" New topic
Author

Foreign keys of a particular Table

Manu Syal
Greenhorn

Joined: Nov 28, 2000
Posts: 4
I need to find the foreign key of a particular table. I am trying this code , but this does not give me all the foreign keys
DatabaseMetaData dbMetaData = con.getMetaData();
rs=dbMetaData.getImportedKeys(null,null,"PROJECT_MASTER");
Vector foreignkey=new Vector ();
Enumeration e5;
while(rs.next())
{
foreignkey.addElement(rs.getString(4));
}
e5=foreignkey.elements();

while(e5.hasMoreElements())
{
out.println((String)e5.nextElement());

}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Foreign keys of a particular Table
 
Similar Threads
getting info about primary and foreign keys
Datatable: Link foreign keys to actual data
[CMP] no default value for nullable foreign key
Foreign keys and indexes
How to make relations inside between mysql database tables