I am using jdbc to connect to the postgresql database in a Java application (actually the application is written in Groovy). I have postgresql installed to use the trust authentication method. Is it possible to open a jdbc connection without specifying a password? When I try to use a regular constructor with an empty password, it fails with
Exception in thread "Thread-2" org.postgresql.util.PSQLException: FATAL: password authentication failed for user "myuser"
Even though it works fine from the command line
psql -U myuser mydatabase Welcome to psql 8.3.5, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit
java postgresql jdbc
mojones
source share