1 //Create Connection, call commit() 10K times.
2 //System should be stable, check this by creating new connection and insert 1 tuple.
4 public class ConnTest26
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));");
16 for (int i
=0; i
<10000; i
++)
19 Connection con2
= DriverManager
.getConnection("jdbc:csql","root","manager");
21 cStmt
= con2
.createStatement();
22 PreparedStatement stmt
= null;
23 stmt
= con2
.prepareStatement("INSERT INTO T1 VALUES (?,?);");
25 stmt
.setString(2,"test1");
26 ret
= stmt
.executeUpdate();
28 System
.out
.println("test failed!");
30 ResultSet rs
= cStmt
.executeQuery("SELECT * from T1;");
36 System
.out
.println("Total rows selected " + count
);
37 cStmt
.execute("DROP TABLE T1;");
39 if (count
==1 ) System
.exit(0); else System
.exit(1);
41 System
.out
.println("Exception in Test: "+e
);