8 public class treeIndexTest
{
10 public static void main(String
[] args
) {
15 int noOfRecords
=10000;
16 Connection con
= connect
.getDBConn();
17 Statement cStmt
= con
.createStatement();
18 cStmt
.execute("CREATE TABLE emp (f1 int, f2 char (20));");
19 cStmt
.execute("create index ind on emp(f1) tree unique;");
20 connect
[] conth
= new connect
[10];
21 System
.out
.println("Table Insert");
22 for(int i
=0;i
<noOfThreads
;i
++)
24 conth
[i
] = new connect(i
,0,noOfRecords
);
26 for(int i
=0;i
<noOfThreads
;i
++)
30 long totalTimeTaken
=0;
31 for(int i
=0;i
<noOfThreads
;i
++)
33 totalTimeTaken
= totalTimeTaken
+ conth
[i
].timeTaken
;
35 System
.out
.println("Table Insert " + totalTimeTaken
);
38 for(int i
=0;i
<noOfThreads
;i
++)
40 conth
[i
] = new connect(i
,1,noOfRecords
);
42 for(int i
=0;i
<noOfThreads
;i
++)
47 for(int i
=0;i
<noOfThreads
;i
++)
49 totalTimeTaken
= totalTimeTaken
+ conth
[i
].timeTaken
;
51 System
.out
.println("Table Select " + totalTimeTaken
);
54 /*for(int i=0;i<noOfThreads;i++)
56 conth[i] = new connect(i,2,noOfRecords);
58 for(int i=0;i<noOfThreads;i++)
62 System.out.println("Table delete");
63 for(int i=0;i<noOfThreads;i++)
65 conth[i] = new connect(i,3,noOfRecords);
67 for(int i=0;i<noOfThreads;i++)
71 System.out.println("Drop Table ");
74 cStmt
.execute("DROP TABLE emp ;");
77 System
.out
.println("Exception in Test: "+e
);