I am having problems using the function getTableName() in class ResultSetMetaData. I am using the SUN JDBCODBC Bridge to connect to MS Access... Any ideas? Is this not supported w/ this Driver?
rani bedi
Ranch Hand
Joined: Feb 06, 2001
Posts: 358
posted
0
ideally you shouldn't be having problems. Can you show us the code?
Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Tapan Parikh
Greenhorn
Joined: Jun 28, 2001
Posts: 26
posted
0
This is the very simple code I am using to test this fxnality (after it wasnt working in my other code). This result Set had 5 columns so there is definitely some columns here... ResultSetMetaData rsmd = rs.getMetaData(); String currentTableName = rsmd.getTableName(1);
Tapan Parikh
Greenhorn
Joined: Jun 28, 2001
Posts: 26
posted
0
Btw the prob is that the string returned is an empty string ""
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
This is a snippet of code from one of my programs. It works for me. Bosun ------------------------------------------------------------ DatabaseMetaData myMT = conn.getMetaData(); String[] myTables = {"TABLE"}; ResultSet tables = myMT.getTables(null, null, "%", myTables); String tableName = null;
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Tapan Parikh
Greenhorn
Joined: Jun 28, 2001
Posts: 26
posted
0
This is not exactly my problem... I am trying to get the table associated with a specific column in a ResultSet generated by a SELECT query. This is important in the case of joins, and also when I just want to find out the particular Table associated with the Results in a ResultSet...
Tapan Parikh
Greenhorn
Joined: Jun 28, 2001
Posts: 26
posted
0
Any ideas about this? Does anyone know if Sun's JDBCODBC driver implementation just doesnt support ResultSetMetaData's getTableName() fxn?
satish bora
Greenhorn
Joined: Jul 16, 2001
Posts: 18
posted
0
I am just wondering whether metadata support is there for the File database-> Access?
Sa
Jayendranath Krishnamoorthy
Greenhorn
Joined: Oct 30, 2004
Posts: 1
posted
0
Hi I too have the same Problem.I am using oracle.jdbc.driver.OracleDriver Connection.
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:
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.