1 //Create Connection, call rollback() 10K times.
2 //System should be stable, check this by creating new connection and insert 1 tuple.
5 public class ConnTest27
7 public static void main(String
[] args
)
11 Class
.forName("csql.jdbc.JdbcSqlDriver");
12 Connection con
= DriverManager
.getConnection("jdbc:csql", "root", "manager");
13 con
.setAutoCommit(false);
14 Statement cStmt
= con
.createStatement();
16 cStmt
.execute("CREATE TABLE T1 (f1 integer, f2 char (20));");
18 for (int i
=0; i
<10000; i
++)
21 Connection con2
= DriverManager
.getConnection("jdbc:csql","root","manager");
23 cStmt
= con2
.createStatement();
24 PreparedStatement stmt
= null;
25 stmt
= con2
.prepareStatement("INSERT INTO T1 VALUES (?,?);");
27 stmt
.setString(2,"test1");
28 ret
= stmt
.executeUpdate();
30 System
.out
.println("test failed!");
32 ResultSet rs
= cStmt
.executeQuery("SELECT * from T1;");
38 System
.out
.println("Total rows selected " + count
);
39 cStmt
.execute("DROP TABLE T1;");
41 if (count
==1) System
.exit(0); else System
.exit(1);
43 System
.out
.println("Exception in Test: "+e
);