File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "why it don Watch "why it don New topic

why it don't work?

zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
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:;

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:
subject: why it don't work?
It's not a secret anymore!