Re: Not able to connect to postgresql database

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Manohar Bhattarai" <manoharbhattarai(at)gmail(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Not able to connect to postgresql database
Date: 2010-06-01 20:27:39
Message-ID: 4C0526EB0200002500031C7D@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Manohar Bhattarai <manoharbhattarai(at)gmail(dot)com> wrote:

> shows an exception that it cannot find driver.

> Please help me and let me know what i am doing wrong and what i am
> missing.

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.)

> Can you please give an example code if possible?

There are examples here:

http://jdbc.postgresql.org/documentation/84/index.html

-Kevin

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Maciek Sakrejda 2010-06-01 20:30:44 Re: Not able to connect to postgresql database
Previous Message Manohar Bhattarai 2010-06-01 20:19:11 Not able to connect to postgresql database