Tapan Parikh wrote:
Any ideas about this? Does anyone know if Sun's JDBCODBC driver implementation just doesnt support ResultSetMetaData's getTableName() fxn?
I'm having this problem also. I know this discussion
thread is old, but this one comes up in my Google search near the top, so here I am. I found this related post on another site:
http://fixunix.com/weblogic/223501-resultsetmetadata-gettablename-int-column-dont-work.html
Hi. Sorry to be the bearer of bad news, but Oracle's DBMS doesn't
send the information about what table a column came from, so the
oracle driver will never be able to implement that resultset
metadata call. Most DBMSes don't either, and so you will see that
99% of all JDBC drivers will also not implement that call to return
anything useful. Only Sybase, with their very latest driver and
a specific optional DBMS configuration, have done it. It takes
a change in the DBMS that most DBMS vendors will never bother to do.
This seems to be what I'm encountering. In a ResultSet from a SELECT statement with joins, there does not appear to be a way to determine what table a particular column in the result set came from. Not great if you have joined two tables that each have a column with the same name.