Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple recordset update trouble

Status
Not open for further replies.

sagn

Programmer
Jun 7, 2001
166
US
Hi

I have written (or am writing) a program to do the following.
Using a JDBC:ODBC bridge

1) Bring down data from three tables (t1,t2,t3)
from two different databases (db1,db2). the tables should contain the same data ie db1.t1=db2.t1
but t1 != t2 in data or format.

2) The data between db1 and db2 tables are compared. The differences are tabulated and presented on separate tabbed panes labled t1,t2,t3.

3) The tables are updatable.


I want the user to be able to update these tables as he views them

This all seems to work just great until I try to update.

I tried creating a different statement for each DB/Table combination. The first DB/Table combination is updated.
Everything after that fails. I've read that the ODBC:JDBC bridge does not support multiple statements on one connection. Could this be my trouble? If so, why does this not manifest until I try and update. (All data is presented and tabulated without incident. I have try:catch artound everything)

I tried to then use ONE statement but as soon as you get another recordset the previous rs is closed.

Is there any way to do what I;d like? Will a different driver work? Any thoughts would be appreciated.

thanks a lot
 
Well, you can only have one ResultSet active on a Statement at any one time, and if the ODBC:JDBC Bridge doesn't support multiple active statements, then you're going to have problems with anything requiring concurrent SQL queries. It's been said many times that 'The ODBC:JDBC Bridge is for experimental use only, and is not a production quality driver'. Apart from that, the JDBC specification does have some rules regarding how things like updates should be performed.

Tim
 
Yes, they do say the JDBC:ODBC bridge should only be used for experimental use. Well, my experiment failed!

Anyway, thanks for confirming my suspicions. I am VERY green as far as JAVA is concerned so I am not yet fully aware of all the nuances!

thanks again
 
MSSQL Server. There are drivers for this which I clearly have to look into.
Once I download the driver, I suppose I use the Class.forName(driver) command. True?

Is that all I have to do to load the driver?

thanks
 
thanks a ton

I seem to be all set now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top