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?
Wayne L Johnson
posted 12 years ago
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 ..