Re: Not able to connect to postgresql database

From: John R Pierce <pierce(at)hogranch(dot)com>
To:
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Not able to connect to postgresql database
Date: 2010-06-01 20:46:13
Message-ID: 4C057195.3010102@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kevin Grittner wrote:
> Manohar Bhattarai <manoharbhattarai(at)gmail(dot)com> wrote:
>
>
>> shows an exception that it cannot find driver.
>>
> The jar is not on your classpath, or you are not spelling the class
> name ("org.postgresql.Driver") correctly. I don't know of any other
> reason that the recommended class loading:
>
> Class.forName("org.postgresql.Driver");
>
> would throw a ClassNotFoundException. (If that's not what you're
> doing, or that's not the statement on which it fails, or that's not
> your exception, you need to give us more clues.)
>

a further clarification, you need to specify the full path and name of
the jdbc jar file in the classpath, its not enough to drop
postgresql-8.4-701.jdbc4.jar into a dir thats in the classpath as it
won't recognize the filename.

btw, you only need one of the jdbc drivers, you listed several different
ones.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jason Tesser 2010-06-01 21:10:21 Re: Found a Bug in latest Driver (I THINK) and pg 8.4
Previous Message Kris Jurka 2010-06-01 20:34:42 Re: Found a Bug in latest Driver (I THINK) and pg 8.4