1 /* 1. Connect to Target DB using connection string "jdbc:adapter".
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
8 * Author : Jitendra Lenka
12 public class ConTest02
14 public static void main(String
[] args
)
18 Class
.forName("csql.jdbc.JdbcSqlDriver");
19 Connection con
= null;
20 con
=DriverManager
.getConnection("jdbc:adapter",null,null);
23 System
.out
.println("Error-1" + con
);
28 //Correct userName and Wrong Password
29 con
=DriverManager
.getConnection("jdbc:adapter","root","MANAGER");
32 System
.out
.println("Error-2" + con
);
38 //wrong userName adn correct password
39 con
=DriverManager
.getConnection("jdbc:adapter","ROOT","manager");
42 System
.out
.println("Error-2" + con
);
48 System
.out
.println("Exception in Test: " +e
);