wood burning stoves 2.0*
The moose likes JDBC and the fly likes why it don't  work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "why it don Watch "why it don New topic
Author

why it don't work?

zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
hello
i write a sql clause-"select * from emp",and want to connect to oracle database(scott/tiger) in my java programmer,after it is executed,the resultset(rset) can be returned correctly,then i invoke following clause:

rset.next();
System.out.println(rset.getString(2));
System.out.println(rset.getMetaData().getTableName(2));

the first clause can return the correct result("smith"),but the second clause return the empty string(" "),the correct result should be "emp".even i change to use the OracleConnection,OracleStatement and OracleResultSet,it still don't work,why?who can help me,and how can i return the table name that the column belong to?

thank you!
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
I tried this and got the same results as you. So I did a little searching on the intenet and found the following on Oracle Technology Network :

OracleResultSetMetaData interface does not implement the getSchemaName() and getTableName() methods because underlying protocol does not make this feasible.

So as long as you use the THIN driver it seems you're out of luck ..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why it don't work?