Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 065114769C6 for ; Tue, 10 Dec 2002 14:15:08 -0500 (EST) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 01E5D47668F for ; Tue, 10 Dec 2002 14:11:24 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id gBAJAod16745; Tue, 10 Dec 2002 14:10:50 -0500 (EST) From: Bruce Momjian Message-Id: <200212101910.gBAJAod16745@candle.pha.pa.us> Subject: Re: FATAL 1: Password authentication failed In-Reply-To: To: Godson Retna Date: Tue, 10 Dec 2002 14:10:49 -0500 (EST) Cc: pgsql-interfaces@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/30 X-Sequence-Number: 3443 I recommend getting the newest jdbc driver from jdbc.postgresql.org. It should fix the problem. What PostgreSQL server release are you using? --------------------------------------------------------------------------- Godson Retna wrote: > Hi > > I have tested some java code to connect to PostgreSQL database using 'trust' > relationship, which works. > > quote: > ---------------------------------------------------------------------------- > ---- > [snathan@sip008 security]$ java Sample > DAtabase :PostGRESQL > Inside Main of Sample #### > Here > Database Driver rg.postgresql.Driver > Database Datasource :jdbcostgresql://192.168.66.3:5432/test > Database Login :u_test > Database Password :u_test > ---------------------------------------------------------------------------- > ---- > > > > However, when I change the pg_hba.conf to have 'password' or 'md5' or > 'crypt', the connection fails with the above error. But, I am able to > connect using 'psql' ... > > quote: > ---------------------------------------------------------------------------- > ---- > [snathan@sip008 security]$ java Sample > DAtabase :PostGRESQL > Inside Main of Sample #### > Here > Database Driver rg.postgresql.Driver > Database Datasource :jdbcostgresql://192.168.66.3:5432/test > Database Login :u_test > Database Password :u_test > Something unusual has occured to cause the driver to fail. Please report > this exception: Exception: java.sql.SQLException: FATAL 1: Password > authentication failed for user "u_test" > > Stack Trace: > > java.sql.SQLException: FATAL 1: Password authentication failed for user > "u_test" > > at org.postgresql.Connection.openConnection(Connection.java:178) > at org.postgresql.Driver.connect(Driver.java:149) > at java.sql.DriverManager.getConnection(DriverManager.java:512) > at java.sql.DriverManager.getConnection(DriverManager.java:171) > at Sample.getConnectionToDatabase(Sample.java:58) > at Sample.main(Sample.java:22) > End of Stack Trace > > at org.postgresql.Driver.connect(Driver.java:166) > at java.sql.DriverManager.getConnection(DriverManager.java:512) > at java.sql.DriverManager.getConnection(DriverManager.java:171) > at Sample.getConnectionToDatabase(Sample.java:58) > at Sample.main(Sample.java:22) > > ---------------------------------------------------------------------------- > ---- > > Thanks for your valuable input. > > Best Regards. > > Godson R. > Chennai, India. > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073