I am doing simple jsp servlet program to check whether the logged user is valid or not?
If I am running db program seperately, then it is working fine that means connection and other things are correct.
But if I am integrating it with JSP & Servlet with valid inputs then it is throwing java.lang.NullPointerException
.
Connection.java
public class ConnectionClass {
public static Connection con=null;
public static Connection getOracleConnection() {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe",Constants.OracleUsername,Constants.OraclePassword);
} catch(Exception e) {
System.out.println("Error to create the connection ");
}
return con;
}
}