Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to determine 1:1, 1:M etc. relationships using DatabaseMetaData

 
Joshua White
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
How can you determine the relationships between tables using DatabaseMetaData?
Looking at some of the methods in the api, it looks like you can only determind pk/fk relationships. Suggesions?
Regards,
Joshua
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getIndexInfo might be helpful too.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joshua,
Pardon my ignorance, but if we are talking about a relational database management system (RDBMS), then what other inter-table relationships are there besides foreign-key relationships?
As far as I know, there are only foreign-key relationships, for which the DatabaseMetaData interface has the methods "getExportedKeys()" and "getImportedKeys()".
Good Luck,
Avi.
[ May 11, 2004: Message edited by: Avi Abrami ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic