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
10 public class ConTest02
12 public static void main(String
[] args
)
16 Class
.forName("csql.jdbc.JdbcSqlDriver");
17 Connection con
= null;
18 con
=DriverManager
.getConnection("jdbc:adapter://localhost:5678",null,null);
21 System
.out
.println("Error-1" + con
);
26 //Correct userName and Wrong Password
27 con
=DriverManager
.getConnection("jdbc:adapter","root","MANAGER");
30 System
.out
.println("Error-2" + con
);
36 //wrong userName adn correct password
37 con
=DriverManager
.getConnection("jdbc:adapter","ROOT","manager");
40 System
.out
.println("Error-2" + con
);
46 System
.out
.println("Exception in Test: " +e
);