Re: Not able to connect to postgresql database

From: Manohar Bhattarai <manoharbhattarai(at)gmail(dot)com>
To: dmp <danap(at)ttc-cmc(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Not able to connect to postgresql database
Date: 2010-06-02 16:18:00
Message-ID: AANLkTikpQQXQc5-u_ifaZqpJK423PAQbnv7smVeQDfwd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, Jun 2, 2010 at 9:09 PM, dmp <danap(at)ttc-cmc(dot)net> wrote:

> Manohar Bhattarai <manoharbhattarai(at)gmail(dot)com> <manoharbhattarai(at)gmail(dot)com> wrote:
>
>
>
> > I have added the jar in classpath also in the CLASSPATH variable> of /etc/environment file. Still I am getting exception :> java.lang.ClassNotFoundException: org.postgresql.Driver.
>
>
>
> You said you were using Eclipse, which I believe sets its own
> classpath for each runnable you set up within it. Look for the
> entry under the "Run..." or "Debug..." menu item and set it up
> there.
>
> -Kevin
>
>
> If you are using Eclipse, and during the initial configuration of the
> project
> the PostgreSQL driver was not present in the project directory then it will
> needed to be added. To set that:
>
> Highlight the Project: Project | Properties | Java Build Path |
> Libraries | Add JARs.
>
> danap.
>
I had added the jar files already but it was giving same exception. But now
the Driver is found. :) Thanks all. It was solved by adding the jar file to
CATALINA_HOME/lib/ directory. Then it found the driver.
But now a new exception 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?

Can you please give me the steps to set up new user and create new database
after a fresh install of postgresql? I have doubts seeing different sites
giving different methods.

Can I follow this link ==> https://help.ubuntu.com/community/PostgreSQL

--
Regards,
Manohar Bhattarai (मनोहर भट्टराई)
Blogs:
http://manoharbhattarai.wordpress.com/
http://manoharbhattarai.posterous.com/
http://manoharbhattarai.blogspot.com/
Microblogs:
Twitter :- http://twitter.com/manoharmailme
Identi.ca :- http://identi.ca/manoharbhattarai

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Grittner 2010-06-02 16:37:42 Re: Not able to connect to postgresql database
Previous Message dmp 2010-06-02 15:39:58 Re: Not able to connect to postgresql database