1 //Test 5000 statements in one connection one after other
6 public static void main(String
[] args
)
10 Class
.forName("csql.jdbc.JdbcSqlDriver");
11 Connection con
= DriverManager
.getConnection("jdbc:csql", "root", "manager");
12 Statement cStmt
= con
.createStatement();
14 cStmt
.execute("CREATE TABLE T1 (f1 integer, f2 char (20));");
16 PreparedStatement stmt
= null;
17 for (int i
=0; i
<5000 ; i
++)
19 stmt
= con
.prepareStatement("INSERT INTO T1 VALUES (?, ?);");
21 stmt
.setString(2, String
.valueOf(i
+100));
22 ret
= stmt
.executeUpdate();
28 System
.out
.println("Total statements created "+ i
);
35 cStmt
= con
.createStatement();
36 System
.out
.println("Listing tuples:");
37 ResultSet rs
= cStmt
.executeQuery("SELECT * from T1;");
43 System
.out
.println("Total rows selected " + count
);
46 cStmt
.execute("DROP TABLE T1;");
48 if (count
!=5000) System
.exit(1); else System
.exit(0);
50 System
.out
.println("Exception in Test: "+e
);