I tried the code with the new catch statements. The strange thing is that it no longer returns an error at all, the page loads fine and the function returns false. (It should return true)
This is the complete code for db.java now:
I don't know if there is a way to make the function print my query, but System.out.println did not work (nothing was printed).
Though, I am pretty sure the sql is ok, because when I changed the last return to true, the whole function returned true.
Btw, the reference looked good, I have read the part about Postgresql but I don't think I have missed anything in the setup.
I'm am currently trying to learn Java and want to connect to a Postgresql database.
I am using a simple JSP page and a bean which contains all database functions. This is set up in Tomcat and JDK/1.6.0. Everything works fine but the connection itself, for some reason it throws a null value.
I suspect that the problem is the connection configuration, in tomcat/conf/context.xml.
Connecting to the database from terminal works fine, using psql -h etc...
This is what I have:
Running login.jsp returns error here:
What am I doing wrong? Help is very much appreciated.