Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id BF1446321EF for ; Sun, 12 Apr 2009 15:48:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 22311-02 for ; Sun, 12 Apr 2009 15:48:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id 765EC632178 for ; Sun, 12 Apr 2009 15:48:39 -0300 (ADT) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Lt4jN-0000Tr-9h for pgsql-jdbc@postgresql.org; Sun, 12 Apr 2009 11:48:37 -0700 Message-ID: <23013717.post@talk.nabble.com> Date: Sun, 12 Apr 2009 11:48:37 -0700 (PDT) From: IronSheikh To: pgsql-jdbc@postgresql.org Subject: Can't get JDBC to compile. Please help. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: kazisiddiqui@gmail.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/43 X-Sequence-Number: 19490 I'm a beginner. I installed PostGRESQL 8.3 with edb_pgjdbc.exe on Windows XP SP2. The following test code won't compile: package javaapplication1; import java.sql.*; public class Main { public static void main(String[] args) { try { helloPostgresql(); } catch (Exception ex) { System.out.println("***Exception:\n"+ex); ex.printStackTrace(); } } public static void helloPostgresql() throws ClassNotFoundException, SQLException { Class.forName("org.postgresql.Driver"); Connection db = DriverManager.getConnection("jdbc:postgresql:pathos", "postgres", "cuy4867z"); PreparedStatement st = db.prepareStatement("INSERT INTO test VALUES (?,?,?)"); st.setInt(1, 5); st.setString(2, "'$10.00'"); st.setString(3, "'full checkup'"); st.executeUpdate(); st.close(); db.close(); } } NetBeans says: ***Exception: java.lang.ClassNotFoundException: org.postgresql.Driver java.lang.ClassNotFoundException: org.postgresql.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at javaapplication1.Main.helloPostgresql(Main.java:36) at javaapplication1.Main.main(Main.java:24) BUILD SUCCESSFUL (total time: 0 seconds) I've tried adding "E:\Program Files\PostgreSQL\pgJDBC" to the CLASSPATH. Any suggestions? -- View this message in context: http://www.nabble.com/Can%27t-get-JDBC-to-compile.-Please-help.-tp23013717p23013717.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.