This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to fetch Table Name

 
Ratheesh Narayanan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a problme in JDBC.

I am not able to fetch table name from my ResultSetMetaData. When I call,

ResultSetMetaData rsmt = resultSet.getMetaData();
strTableName = rsmt.getTableName();

the strTableName does not assign with table name.

And I could read an article saying that the getTableName() method only returns meaningful information for OBDC compliant databases. For all other databases, this method returns an empty string.

So is there any other way to get the table name from the metadata???

Please help me if anyone has done it before..

Thanks in advance,

Ratheesh
 
Wei Dai
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ResultSetMetaData.getTableName() return table name or "" if not applicable

>is there any other way to get the table name from the metadata???
No way, except for extracting table name from the original sql by yourself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic