lock manager and chunk allocation mutex modificationsw
[csql.git] / test / jdbc / network / Adapter / ConTest02.java
blob63c212605ee5ef83c5093eca61ae9c035b86595d
1 /* 1.Connect to Target DB using connection string "jdbc:adapter://localhost:5678".
3 * 2. Used null properties object
4 * 3. Coreect username and wrong password
5 * 4. Wrong UserName and Correct password
6 * 5. Above all three should fail
7 */
9 import java.sql.*;
10 public class ConTest02
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",null,null);
19 if(con != null)
21 System.out.println("Error-1" + con);
22 con.close();
23 System.exit(1);
26 //Correct userName and Wrong Password
27 con=DriverManager.getConnection("jdbc:adapter","root","MANAGER");
28 if(con != null)
30 System.out.println("Error-2" + con);
31 con.close();
32 System.exit(2);
36 //wrong userName adn correct password
37 con=DriverManager.getConnection("jdbc:adapter","ROOT","manager");
38 if(con != null)
40 System.out.println("Error-2" + con);
41 con.close();
42 System.exit(2);
45 }catch(Exception e){
46 System.out.println("Exception in Test: " +e);
47 e.getStackTrace();
48 System.exit(0);