Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id F39B863264E for ; Wed, 2 Jun 2010 18:31:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 34901-06 for ; Wed, 2 Jun 2010 21:31:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id 548756323FF for ; Wed, 2 Jun 2010 18:31:05 -0300 (ADT) Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id o52LV1n26486 for ; Wed, 2 Jun 2010 14:31:01 -0700 Message-ID: <4C06CD8F.4030304@hogranch.com> Date: Wed, 02 Jun 2010 14:30:55 -0700 From: John R Pierce User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: undisclosed-recipients:; Subject: Re: Exception while accessing database References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/157 X-Sequence-Number: 163694 Manohar Bhattarai wrote: > Hi, > This problem was initially asked to pgsql-jdbc@postgresql.org > and I was suggested to ask this > problem here. > So my initial problem was that i was not able to set the Driver for > postgresql. I solved that problem with the help there. > > But I have a new exception and it is : > org.postgresql.util.PSQLException: FATAL: password authentication > failed for user "postgres" > > I am giving the line for connection that i am using : > connection = DriverManager.getConnection(connectionURL, "postgres", > "mypasswordhere"); > > But the password is the same that i use to login postgres user in the > terminal. > What could be the problem? > from the psql command line tool, ALTER USER username WITH PASSWORD 'mypasswordhere'; However, your app probably shouldn't be using the postgres account, instead it should be using a different account (and database) CREATE USER someuser WITH PASSWORD 'somepassword'; CREATE DATABASE somedatabase WITH OWNER someuser; then use that user and database instead. .....