Jeff Mathis wrote:
> Kishor Patil wrote:
>
>> Does mysql Connector/J support transaction?
>> I am using mysql-connector-java-3.0.14-production-bin.jar driver. and
>> 5.0-alpha server.
>> But still queries dont rollback. Sample code:
>> con.setAutoCommit(false);
>> String query = "insert into cat_operation
>> values(3,'ex1','N')";
>> java.sql.Statement statement = con.createStatement();
>> statement.executeUpdate(query);
>> con.rollback();
>> //con.commit();
>> System.out.println("End");
>>
>> What could be the reason?
> Only if you are using InnoDB tables.
>
> (or BerkelyDB tables, but I'm not absolutely sure about these)
BDB tables are transaction safe as well. I have used Connector/J with both BDB
and InnoDB tables. I believe MySQL tables are MyISAM by default.
--
Lynn Hollerman.