• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getColumns() method on Databasemetadata returns empty for table synonyms

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What database backend and driver are you using? I've not seen this problem with views but it may be a driver issue.
 
Bhagya Tangutur
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic