| 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
|
 |
 |
|
|
subject: getColumns() method on Databasemetadata returns empty for table synonyms
|
|
|