adding test scripts
[csql.git] / test / jdbc / Threads / noIndexTest.java
blob52dbcbacfe5ac11974f7a0d504ff7c074c3ac066
1 /*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
6 import java.sql.*;
7 /**
9 * @author bijaya
12 public class noIndexTest{
14 public static void main(String[] args) {
15 try
19 int noOfThreads=5;
20 int noOfRecords=1000;
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 connect[] conth= new connect[10];
26 System.out.println("Table Insert");
27 for(int i=0;i<noOfThreads;i++)
29 conth[i] = new connect(i,0,noOfRecords);
31 for(int i=0;i<noOfThreads;i++)
33 conth[i].th.join();
35 System.out.println("Table Select");
37 for(int i=0;i<noOfThreads;i++)
39 conth[i] = new connect(i,1,noOfRecords);
41 for(int i=0;i<noOfThreads;i++)
43 conth[i].th.join();
45 System.out.println("Table Update");
46 for(int i=0;i<noOfThreads;i++)
48 conth[i] = new connect(i,2,noOfRecords);
50 for(int i=0;i<noOfThreads;i++)
52 conth[i].th.join();
54 System.out.println("Table delete");
55 for(int i=0;i<noOfThreads;i++)
57 conth[i] = new connect(i,3,noOfRecords);
59 for(int i=0;i<noOfThreads;i++)
61 conth[i].th.join();
64 System.out.println("Drop Table ");
66 cStmt.execute("DROP TABLE emp ;");
67 con.close();
68 }catch(Exception e) {
69 System.out.println("Exception in Test: "+e);
70 e.printStackTrace();