Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group