2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
12 public class hashIndexTest
{
14 public static void main(String
[] args
) {
21 Class
.forName("csql.jdbc.JdbcSqlDriver");
22 Connection con
= DriverManager
.getConnection("jdbc:csql:", "root", "manager");
23 Statement cStmt
= con
.createStatement();
24 cStmt
.execute("CREATE TABLE emp (f1 int, f2 char (20));");
25 cStmt
.execute("create index ind on emp(f1) hash unique;");
26 connect
[] conth
= new connect
[10];
27 System
.out
.println("Table Insert");
28 for(int i
=0;i
<noOfThreads
;i
++)
30 conth
[i
] = new connect(i
,0,noOfRecords
);
32 for(int i
=0;i
<noOfThreads
;i
++)
36 System
.out
.println("Table Select");
38 for(int i
=0;i
<noOfThreads
;i
++)
40 conth
[i
] = new connect(i
,1,noOfRecords
);
42 for(int i
=0;i
<noOfThreads
;i
++)
46 System
.out
.println("Table Update");
47 for(int i
=0;i
<noOfThreads
;i
++)
49 conth
[i
] = new connect(i
,2,noOfRecords
);
51 for(int i
=0;i
<noOfThreads
;i
++)
55 System
.out
.println("Table delete");
56 for(int i
=0;i
<noOfThreads
;i
++)
58 conth
[i
] = new connect(i
,3,noOfRecords
);
60 for(int i
=0;i
<noOfThreads
;i
++)
65 System
.out
.println("Drop Table ");
67 cStmt
.execute("DROP TABLE emp ;");
70 System
.out
.println("Exception in Test: "+e
);