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