Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes getColumns() method on Databasemetadata returns empty for table synonyms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "getColumns() method on Databasemetadata returns empty for table synonyms" Watch "getColumns() method on Databasemetadata returns empty for table synonyms" New topic
Author

getColumns() method on Databasemetadata returns empty for table synonyms

Bhagya Tangutur
Ranch Hand

Joined: Oct 21, 2002
Posts: 88
How can i get Information about table columns from TableSynonym.
getColumns name in DatabaseMetadata returns empty result set for tableSynonyms.

because of security restrictions and for easy database maintainence i should not use table names itself.

I am using following method to check number of columns in Table synonym.
passing tableSynonym for tableName pattern argument.

getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
Retrieves a description of table columns available in the specified catalog.

Do you guys suggest any work around to get Columns associated with real table from its synonym.


Sun Certified Java Programmer
Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
What database backend and driver are you using? I've not seen this problem with views but it may be a driver issue.


<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Bhagya Tangutur
Ranch Hand

Joined: Oct 21, 2002
Posts: 88
i am using Oracle thin driver.
Infact i am able to retrieve columns for table synonym,i set the property setINcludeSynonyms(true) on
oracle.jdbc.driver.OracleConnection from ther eit works fine.

Now when i am trying to get Primary keys through table synonym.I am getting
empty result set for it.Please let me know if you have any solution for it.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getColumns() method on Databasemetadata returns empty for table synonyms