Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to fetch Table Name  RSS feed

 
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
 
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
Boost this thread!