• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle JDBC drivers do not support getTableName()

 
Deependra Sharma
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic