File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How to fetch Table Name Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "How to fetch Table Name" Watch "How to fetch Table Name" New topic
Author

How to fetch Table Name

Ratheesh Narayanan
Ranch Hand

Joined: Oct 30, 2004
Posts: 38
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


SCJP 1.4 & SCBCD 1.5
Wei Dai
Ranch Hand

Joined: Jun 22, 2005
Posts: 81
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to fetch Table Name
 
Similar Threads
How to retrive Table names in a database
jtree and database
Help Regarding ResultSetMetaData
How would I dump the contents of a table to text?
Oracle JDBC drivers do not support getTableName()