adding test scripts
[csql.git] / test / jdbc / network / Adapter / ConTest01.java
blobd4ef8dda213c32c7c663920d67ebd63160bb5fff
1 /* 1. Connect to Target DB using connection string "jdbc:adapter://localhost:5678".
3 * 2. Used correct UserName and Password.
4 * 3. Connect to the Target DB and Close the Connection
5 * 4. Again Connect and Close.
6 * 5. It should pass.
7 */
9 import java.sql.*;
10 public class ConTest01
12 public static void main(String[] args)
14 try
16 Class.forName("csql.jdbc.JdbcSqlDriver");
17 Connection con = null;
18 con=DriverManager.getConnection("jdbc:adapter://localhost:5678","root","manager");
19 if(con != null)
21 System.out.println("Connect to Target DB");
23 else
25 System.out.println("Failed to Connect");
26 System.exit(1);
28 con.close();
29 System.out.println("Connection Closed");
30 //-----------------------------
31 con=DriverManager.getConnection("jdbc:adapter","root","manager");
32 if(con != null)
34 System.out.println("Again Connect to Target DB");
36 else
38 System.out.println("Failed to Connect to Target DB");
39 System.exit(1);
41 con.close();
42 System.out.println("Connection Closed");
43 System.exit(0);
44 }catch(Exception e){
45 System.out.println("Exception in Test: " +e);
46 e.getStackTrace();
47 System.exit(1);