Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getting primary key metadata for a synonym'ed table

John GreggJun 9 2010 — edited Nov 20 2014
Hi all,

Is it possible to get DatabaseMetaData.getPrimaryKeys() to return anything useful if the "table" is a synonym? I can't get it to work. I've set the includeSynonyms property on the connection, and that at least helps me see the table, but I'm using DBUnit, which depends on being able to discover the pk columns through the metadata. It works for all of my other tables, but not the one for which there is a synonym.

I tried creating a synonym for the pk itself, but it's not associated with the table for which it's a pk.

I have the case and schema correct, AFAIK. I did try lowercase on the table name, but it didn't make a difference.

I'm using the 10.2.0.2 thin driver.

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2010
Added on Jun 9 2010
2 comments
2,211 views