1 //execute with select,get result set and close the result set and then call fetch, it should fail
7 public class TestScript12
{
8 public static Connection con
;
9 public static Statement cStmt
;
10 public static void main(String
[] args
)
14 Class
.forName("csql.jdbc.JdbcSqlDriver");
15 con
= DriverManager
.getConnection("jdbc:csql", "root", "manager");
16 cStmt
= con
.createStatement();
17 cStmt
.execute("CREATE TABLE T1 (f1 integer, f2 integer);");
19 PreparedStatement stmt
= null, selStmt
= null;
20 stmt
= con
.prepareStatement("INSERT INTO T1 VALUES (?,?);");
27 cStmt
= con
.createStatement();
28 cStmt
.execute("SELECT * from T1;");
29 ResultSet rs
=cStmt
.getResultSet();
31 System
.out
.println("Record: " + rs
.getInt(1)+ " "+ rs
.getInt(2));
34 System
.out
.println("Failed:rs.next succedded");
39 System
.out
.println("Exception in Test: "+e
);
43 }catch(Exception ex
){}