adding test scripts
[csql.git] / test / jdbc / Connection / ConnTest19.java
blobdc34a9a9df5a8b0ccc5154eca6a497e9702c3012
1 //Close the connection and then call preparedStatement(). It should fail
2 //Author: XieLiang
3 import java.sql.*;
4 public class ConnTest19
6 public static void main(String[] args)
8 try
10 Class.forName("csql.jdbc.JdbcSqlDriver");
11 Connection con = DriverManager.getConnection("jdbc:csql", "root", "manager");
12 if ( con == null )
13 System.exit(1);
14 con.close();
15 PreparedStatement pStmt = null;
16 pStmt = con.prepareStatement("create table t1(f1 integer);");
17 if (pStmt != null)
18 System.exit(1);
19 }catch(Exception e) {
20 System.out.println(e.getMessage());
21 e.getStackTrace();
22 if (e.getMessage().equals("Invalid state")) System.exit(0);
23 else System.exit(1);