Tag:Reprinted from

  • Transaction example in JDBC in Java

    Time:2019-10-4

    [Learning Notes] 7. JDBC transaction example: import java.sql.*; public class MySQlTransaction1 {   public static void main(String[] args) throws SQLException {/*in my sql: create table Accounts(                ID int(4) not null,                NAME varchar(15),                BALANCE int(4),                primary key(ID)            )  type=INNODB;  insert into Accounts values(1,’wangwu’,100);  insert into Accounts values(3,’zhangsan’,300);  insert into Accounts values(4,’lisi’,400);     */    Connection con = null;    […]