lock manager and chunk allocation mutex modificationsw
[csql.git] / test / jdbc / network / Statement / TestScript4.java
blob9dc6deadcd0077c656d4611798303c93834d370f
1 //ExecuteUpdate for SELECT statement it should not return resultset throw exception
3 import java.sql.Connection;
4 import java.sql.DriverManager;
5 import java.sql.PreparedStatement;
6 import java.sql.ResultSet;
7 import java.sql.Statement;
9 /**
11 * @author bijaya
13 public class TestScript4
15 public static void main(String[] args)
17 try
19 Class.forName("csql.jdbc.JdbcSqlDriver");
20 Connection con = DriverManager.getConnection("jdbc:csql://localhost:5678", "root", "manager");
21 Statement cStmt = con.createStatement();
22 cStmt.execute("CREATE TABLE T1 (f1 integer, f2 char (20));");
23 PreparedStatement stmt = null, selStmt= null;
24 stmt = con.prepareStatement("INSERT INTO T1 VALUES (?, NULL);");
25 for (int i =0 ; i< 10 ; i++) {
26 stmt.setInt(1, i);
27 stmt.executeUpdate();
29 stmt.close();
30 con.commit();
31 selStmt = con.prepareStatement("SELECT * from T1 ;");
32 ResultSet rs = null;
33 System.out.println("yes");
34 int result = selStmt.executeUpdate();
35 /* while (rs.next())
37 int f1=rs.getInt(1);
38 if(rs.wasNull())
39 System.out.print(" NULL");
40 else
41 System.out.print(" "+ f1);
42 String f2=rs.getString(2);
43 if(rs.wasNull())
44 System.out.println(" NULL");
45 else
46 System.out.println(" "+ f2);
48 rs.close();
49 */
50 cStmt.executeUpdate("Drop table T1;");
51 con.close();
52 }catch(Exception e) {
53 System.out.println("Exception in Test: "+e);
54 e.printStackTrace();
55 System.exit(0);