List:MySQL and Java« Previous MessageNext Message »
From:Hollerman Geralyn M Date:August 26 2004 4:53pm
Subject:Re: Help: Urgent
View as plain text  
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.
Thread
Help: UrgentKishor Patil26 Aug
  • Re: Help: UrgentJeff Mathis26 Aug
    • Re: Help: UrgentHollerman Geralyn M26 Aug
  • Re: Help: UrgentMark Matthews26 Aug