From: | Peter Mount <pgsqlgen(at)retep(dot)org(dot)uk> |
---|---|
To: | Natali Kolker <natali(at)u(dot)washington(dot)edu> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: [GENERAL] Question about jdbc |
Date: | 1998-06-12 17:49:04 |
Message-ID: | Pine.LNX.3.95.980612184258.11243A-100000@retep.org.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, 12 Jun 1998, Natali Kolker wrote:
> I compiled JDBC sources , that comes with version 6.3 .
If possible, upgrade to 6.3.2, as it has a more fuller JDBC
implementation, and fewer bugs.
> When I am trying to connect to data base ,
>
> "DriverManager.getConnection("jdbc:postgresql://haver:5432/natali",
> "natali", "Elina);"
> I got a response:
> >
> > java.sql.SQLException: User authentication failed
What do you have set in your pg_hba.conf file?
> My jdbc drivers in dir $CLASSPATH/postgresql,
> I created my database with command:
> createdb -u natali
> Username : natali,
> Password: Elina
>
> In perl I write : $conn = Pg::connectdb("dbname = natali");,
> and I have connection.
>
> If somebody can help me , with my " authentification" problem , I would
> really appriciate it.
JDBC only works using TCP/IP, but (someone correct me if I'm wrong), the
Perl interface can use Unix domain sockets, so if you have a different
setting in pg_hba.conf, it can cause the fact that perl can connect, but
JDBC not.
Also, if you defined pg_hba.conf to use password or crypt authentication,
ensure you have defined the user in the database, AND a password. A blank
password doesn't work.
Postgresql-JDBC FAQ: http://www.retep.org.uk/postgres
--
Peter T Mount peter(at)retep(dot)org(dot)uk or petermount(at)earthling(dot)net
Main Homepage: http://www.retep.org.uk
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter(at)maidstone(dot)gov(dot)uk
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Tong | 1998-06-12 20:35:45 | PostgreSQL Database and PgAccess |
Previous Message | eric | 1998-06-12 17:48:49 | Authentication problem |