From: Dave Cramer <pg@fastcrypt.com>
To: Chandra ASGI Tech <chandraasgi@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9
Date: Tue, 1 Jul 2008 10:33:08 -0400
Message-ID: <982688B8-EB05-4C8B-BD78-ED3C304B24DD@fastcrypt.com> (raw)
In-Reply-To: <fbf9dcc60807010628m51d7ede2lb3b4ac0732593726@mail.gmail.com>
References: <fbf9dcc60807010628m51d7ede2lb3b4ac0732593726@mail.gmail.com>
You have used a capital P in the url jdbc:Postgresql://localhost:5432/
postgres","postgres","1234");
Dave
On 1-Jul-08, at 9:28 AM, Chandra ASGI Tech wrote:
> I have PostgreSQL 8.2.9 on Windows XP, with JDK 1.6.0_06. Have got
> the postgresql-8.2-508.jdbc4.jar jdbc driver in /lib/ext of the
> Java folder.
>
> HAve set both the PATH and CLASSPATH aporpriately
>
> My Java code for testing is:
>
> import java.sql.*;
>
> class postgreSQLTest
> {
>
> public static void main (java.lang.String[] args) throws Exception {
>
> try{
>
> Class.forName("org.postgresql.Driver");
>
> Connection con =
> DriverManager.getConnection("jdbc:Postgresql://localhost:5432/
> postgres","postgres","1234");
>
> Statement stmt = con.createStatement();
> ResultSet rs = stmt.executeQuery("select * from country");
>
> while(rs.next())
>
> {
>
> System.out.println(rs.getString(1)+"<br>");
>
> }
>
> }catch(Exception e){
>
> System.out.println(e);
>
> }
>
> }
>
> }
>
>
> But I get the error
> Exception in thread "main" java.lang.NoClassDefFoundError:
> postgreSQLTest
>
>
> Any help? Thanks in advance.
>
>
> - ChandraASGI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: pg@fastcrypt.com, chandraasgi@gmail.com
Subject: Re: JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9
In-Reply-To: <982688B8-EB05-4C8B-BD78-ED3C304B24DD@fastcrypt.com>
References: <fbf9dcc60807010628m51d7ede2lb3b4ac0732593726@mail.gmail.com> <982688B8-EB05-4C8B-BD78-ED3C304B24DD@fastcrypt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox