adding test scripts
[csql.git] / test / jdbc / network / Gateway / GwTest7.java
blob7beb64f68b760ee377edf2b8bc55ce96e0770442
1 //Donot Start CSQL Server
2 //Open the connection through jdbc:gateway://localhost:5678 and then call isClosed(). It should return false.
3 //Close the connection jdbc:gateway://localhost:5678 and then call isClosed(). It should return true
4 import java.sql.*;
5 /**
7 * @Author : Nihar
8 */
9 public class GwTest7 {
11 public static void main(String[] args)
13 try
15 Class.forName("csql.jdbc.JdbcSqlDriver");
16 Connection con = DriverManager.getConnection("jdbc:gateway://localhost:5678", "root", "manager");
17 if ( con == null )
18 System.exit(1);
19 if(con.isClosed()) {
20 System.out.println("Test Case Failed");
21 System.exit(1);
23 con.close();
24 if(!con.isClosed())
26 System.out.println("Test Case Failed");
27 System.exit(1);
29 System.out.println("Test Case Passed");
30 }catch(Exception e) {
31 System.out.println(e.getMessage());
32 e.getStackTrace();
33 System.exit(1);