Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1808164FD63 for ; Tue, 1 Jul 2008 10:29:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 38150-05 for ; Tue, 1 Jul 2008 10:29:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from hs-out-0708.google.com (hs-out-0708.google.com [64.233.178.251]) by postgresql.org (Postfix) with ESMTP id 6CC92650E7D for ; Tue, 1 Jul 2008 10:28:59 -0300 (ADT) Received: by hs-out-0708.google.com with SMTP id x43so389366hsb.3 for ; Tue, 01 Jul 2008 06:28:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=Lyxk2be/MYne4IXH0GEn/KEHJovzheASHJD+MksRHUw=; b=FYWZfnQ7IFUPgX0GOcQSppx4efnV4arKRHzER8Q4LPOtdyVoK8RT3lR/5XPum479FX MW47HXZ/0s9Z/R9nZ3a4llvdMBmwg2J3LPWZmzrNzhHSDWvCdPN0KgqgX2Gi6grMoPyv jCt6MprW4hMAX9OYHYMBP+E5WeC5EGZwkz4XE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=U7qh8vr3XpvNjjyfr9OHFKIeUuT/UfTngFHi1TFhYsBh2z8gvG/MhpIn70Ezad1P5X RP1Xgq6o1jPjcAY32ciJBjsPu4uvzpjhZ/KeSZBko63rhjCSdz1X9Q50BWDjeVPQAryJ AtGyen0z1Dx3yYlFS6JJye38FwcQdYuYplk+Q= Received: by 10.100.254.18 with SMTP id b18mr2533901ani.17.1214918935176; Tue, 01 Jul 2008 06:28:55 -0700 (PDT) Received: by 10.101.70.4 with HTTP; Tue, 1 Jul 2008 06:28:55 -0700 (PDT) Message-ID: Date: Tue, 1 Jul 2008 09:28:55 -0400 From: "Chandra ASGI Tech" To: pgsql-jdbc@postgresql.org Subject: JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5538_1322457.1214918935124" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200807/1 X-Sequence-Number: 18786 ------=_Part_5538_1322457.1214918935124 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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)+"
"); } }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 ------=_Part_5538_1322457.1214918935124 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

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
------=_Part_5538_1322457.1214918935124--