This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Here stmt = con.createStatement(); the con object is having the value null, you can check this by debugging your application. At run time it happens something like this null.createStatement() which is false. I can help if you attached all the Files related to it (LoginDAO.java , LoginAction.java).
String connectionURL = "jdbc:postgresql://localhost:5432/cities";
// Change the connection string according to your db, ip, username and password
// If you are using any other database then load the right driver here.
//Create the connection using the static getConnection method
con = DriverManager.getConnection (connectionURL,username,password);
add this lines before
“Anyone who has never made a mistake has never tried anything new.” ― Albert Einstein
What is classes.jar? If a missing jar file is the OP's issue, we need a lot more info before trying to figure out what's missing. Most likely, the code that is trying to establish the connection is failing., We need to find out why before applying random guesses as to what is wrong.