File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes mysql autocommit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "mysql autocommit" Watch "mysql autocommit" New topic
Author

mysql autocommit

Natraj Gudla
Ranch Hand

Joined: Feb 09, 2003
Posts: 34
Hi,
I am unable to switch off the autocommit mode thru my code in java , while connecting to mysql.
here, it commits all the queries which i execute immediately..
and the version of mysql which i am using is 3.23.53 ,
can anyone help me...
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

So are you trying to use transactions? There are a couple of things you need to do.
First, tell us what Driver and what Driver version you are using to access the database. Some drivers don't support some features. I would suggest the latest version of the Connecter/J Driver which is 3.0.8.
Second, what type are your tables in mysql? If I remember correctly, InnoDB is the only type that supports Transactions.


GenRocket - Experts at Building Test Data
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Does MySQL 3.23 support transactions at all?


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Natraj Gudla
Ranch Hand

Joined: Feb 09, 2003
Posts: 34
ya, sorry that i did not give the details
I am using the "org.gjt.mm.mysql.Driver" class as the driver
and my application requires to connect to the "mysql" database,
create a new database as given by the user
and create a new user , grant privileges to the user on the new database,
and then exit the application.
here i am working on the "user" and the "db" tables of the mysql database , connecting to it using the "root" and with no password.
regards
Justin Chudgar
Greenhorn

Joined: Aug 19, 2003
Posts: 1
Make sure that you are not using ISAM or MyISAM tables. they do not support transactions. InnoDB and BDB(?) do. If you have the MySQL Control Center installed you can get the info you need from the table properties.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: mysql autocommit
 
Similar Threads
EJB 3 Stateful BMT SessionBean Open Transaction not behaving properly
hibernate: couldn't turn off autocommit
Does a Connection commit on close?
setAutoCommit(false) not working
storing date in mysql