freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: nnklak AT yahoo.com
- To: freetds AT franklin.oit.unc.edu
- Subject: RE: Transaction problems...
- Date: Fri, 4 Jan 2002 14:51:27 -0500
Hi, I am facing a similar problem, the question is:
Why the following code does NOT work (no inserts in the DB)
Connection.setAutoCommit(false);
Statement stInsertSQL = Connection.createStatement();
stInsertSQL.execute("INSERT INTO table1 values(1,2)");
st.close();
Connection.commit();
Connection.setAutoCommit(true);
Connection.close();
While the following code seems to work:
Connection.setAutoCommit(false);
Statement stInsertSQL = Connection.createStatement();
stInsertSQL.execute("INSERT INTO table1 values(1,2)");
//st.close();
Connection.commit();
st.close();
Connection.setAutoCommit(true);
Connection.close();
I have to insert 500 rows in the DB as a transaction; Do I have to keep
500 Statement variables until the Connection.commit()statement ?
Thanks
- Nikolas
-
Transaction problems...,
Kalyan Chakaravarthy, 01/03/2002
- <Possible follow-up(s)>
- RE: Transaction problems..., Jeff Fisher, 01/03/2002
- RE: Transaction problems..., Winkless, Geoff, 01/03/2002
- Re: Transaction problems..., Michael Horowitz, 01/03/2002
- Re: Transaction problems..., Michael Peppler, 01/03/2002
- Re: Transaction problems..., Jeff Fisher, 01/03/2002
- Re: Transaction problems..., Michael Horowitz, 01/03/2002
- Re: Transaction problems..., Mark J. Lilback, 01/03/2002
- RE: Transaction problems..., Kalyan Chakaravarthy, 01/03/2002
- RE: Transaction problems..., nnklak, 01/04/2002
- RE: Transaction problems..., Jeff Fisher, 01/04/2002
- RE: Transaction problems..., Michael Horowitz, 01/04/2002
- RE: Transaction problems..., Kalyan Chakaravarthy, 01/04/2002
Archive powered by MHonArc 2.6.24.