• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Oracle JDBC drivers do not support getTableName()

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have downloaded both ojdbc14.jar and classes12.zip oracle jdbc drivers from the Oracle site, but both do not support getTableName() method. It just returns an empty string.

What is the possible solution to this problem. I need to get the table name of each field in the ResultsetMetaData.
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sharma,


I need to get the table name of each field in the ResultsetMetaData


I would suggest that you probably don't, because whoever created the SQL query, that you obtained the "ResultSet" from, knows what columns belong to what tables, so ask them to pass that data on to you.

What happens when you have an expression, or an alias (instead of a column)?

Since Oracle's JDBC driver does not support the "getTableName()" method (because it's probably too difficult, anyway), you could try directly querying Oracle's data dictionary, or try the "DatabaseMetaData" interface.

Good Luck,
Avi.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic