test cases for trie index
[csql.git] / test / jdbc / Adapter / ConTest02.java
blob7302baabdf6f5a7bba618d44fb6fe79d11dec46a
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
9 */
11 import java.sql.*;
12 public class ConTest02
14 public static void main(String[] args)
16 try
18 Class.forName("csql.jdbc.JdbcSqlDriver");
19 Connection con = null;
20 con=DriverManager.getConnection("jdbc:adapter",null,null);
21 if(con != null)
23 System.out.println("Error-1" + con);
24 con.close();
25 System.exit(1);
28 //Correct userName and Wrong Password
29 con=DriverManager.getConnection("jdbc:adapter","root","MANAGER");
30 if(con != null)
32 System.out.println("Error-2" + con);
33 con.close();
34 System.exit(2);
38 //wrong userName adn correct password
39 con=DriverManager.getConnection("jdbc:adapter","ROOT","manager");
40 if(con != null)
42 System.out.println("Error-2" + con);
43 con.close();
44 System.exit(2);
47 }catch(Exception e){
48 System.out.println("Exception in Test: " +e);
49 e.getStackTrace();
50 System.exit(0);