Using Tomcat 8.0 and Postgre on Windows (8), and I get the following error when trying to connect to the database (both Tomcat and Postgre are local installs).
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "user" java.lang.NullPointerException
I confirmed the login information with the user settings in Postgre and the user is set as the owner of the database with all permissions.
The database can be connected to from pgAdmin III alright and queried.
I've added the following line to pg_hba.conf
host all all 127.0.0.1/32 md5
I've set the listen address to "*" in postgresql.conf.
Using the following to connect:
static String url = "jdbc:postgresql://127.0.0.1:5432/database";
static String user = "user";
static String password = "password";
Connection conn = DriverManager.getConnection(url, user, password);
Disabled any firewalls, etc, just in case.
I've looked through similar threads, and the solutions for other people hasn't worked for me. Any ideas would be really appreciated.
Aucun commentaire:
Enregistrer un commentaire