X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9E65352875 for ; Sat, 25 Jun 2005 01:41:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 16506-10 for ; Sat, 25 Jun 2005 04:41:20 +0000 (GMT) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.72]) by svr1.postgresql.org (Postfix) with ESMTP id 3466552832 for ; Sat, 25 Jun 2005 01:41:19 -0300 (ADT) Received: from mac.com (smtpin02-en2 [10.13.10.147]) by smtpout.mac.com (Xserve/8.12.11/smtpout15/MantshX 4.0) with ESMTP id j5P4fIxr017740 for ; Fri, 24 Jun 2005 21:41:18 -0700 (PDT) Received: from [172.16.80.118] (host-200-52-112-76.block.alestra.net.mx [200.52.112.76]) (authenticated bits=0) by mac.com (Xserve/smtpin02/MantshX 4.0) with ESMTP id j5P4f6Jc029984 for ; Fri, 24 Jun 2005 21:41:13 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v730) To: pgsql-jdbc@postgresql.org Message-Id: <1836DA42-89E0-486D-8DB3-A4715AD0F81F@mac.com> Content-Type: multipart/alternative; boundary=Apple-Mail-1--366656966 From: enrique.ibarra@mac.com Subject: Problems loading the driver Date: Fri, 24 Jun 2005 23:41:03 -0500 X-Mailer: Apple Mail (2.730) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.179 tagged_above=0 required=5 tests=HTML_MESSAGE, NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200506/130 X-Sequence-Number: 13092 --Apple-Mail-1--366656966 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hello: I am trying to compile a very simple Java J2SE program that will connect to a Postgres database. I am using: * an Apple computer running Mac OS/X 10.4 * Postgres 8.0 * JDBC driver postgresql-8.0-311.jdbc3.jar The JDBC jar file IS in the CLASSPATH environment variable. The code of the program is the following: public static void main (String[] args) { try { Class.forName ("org.postgresql.Driver"); } catch (ClassNotFoundException e) { System.out.println (e.getMessage ()); e.printStackTrace (); } The program compiles fine but the error message I get when I run the program is the following: [Session started at 2005-06-24 23:32:14 -0500.] org.postgresql.Driver java.lang.ClassNotFoundException: org.postgresql.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:199) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gastos.main(gastos.java:17) I have tried placing the JDBC jar file at different directories while adjusting the CLASSPATH variable but I keep getting the same annoying error. I also tried the -cp flag when invoking 'java' to execute the program, but it does not work. I ran out of ideas and the exercise is becoming very frustrating. Any suggestions will be highly appreciated. Thanks a lot in advance. Regards, Enrique --Apple-Mail-1--366656966 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 Hello:

I am trying to compile a = very=A0simple Java J2SE program that will connect to a Postgres = database. I am using:
* an Apple computer running Mac OS/X = 10.4
* Postgres 8.0
* JDBC driver=A0postgresql-8.0-311.jdbc3.jar

The JDBC jar file = IS in the CLASSPATH environment variable. The code of = the program is the following:

=A0=A0 = =A0public = static = void main (String[] = args) {

=A0=A0 =A0 =A0 = =A0

=A0 =A0 =A0 =A0 = try = {
=A0 =A0 =A0 =A0 =A0 =A0 = Class.forName ("org.postgresql.Driver");
=A0 =A0 =A0 =A0 } = catch = (ClassNotFoundException e) {
=A0 =A0 =A0 =A0 =A0 =A0 = System.out.println (e.getMessage ());
=A0 =A0 =A0 =A0 =A0 = =A0 e.printStackTrace ();
=A0 =A0 =A0 =A0 }

The program = compiles fine but the error message I get when I run the program is the = following:

[Session started at = 2005-06-24 23:32:14 = -0500.]
org.postgresql.Driver
java.lang.ClassNotFoundE= xception: org.postgresql.Driver
=A0 =A0 at = java.net.URLClassLoader$1.run(URLClassLoader.java:199)
=A0 =A0 = at java.security.AccessController.doPrivileged(Native = Method)
=A0 =A0 at = java.net.URLClassLoader.findClass(URLClassLoader.java:187)
=A0 = =A0 at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
=A0= =A0 at = sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
=A0= =A0 at = java.lang.ClassLoader.loadClass(ClassLoader.java:235)
=A0 =A0 = at = java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
=A0= =A0 at java.lang.Class.forName0(Native Method)
=A0 =A0 at = java.lang.Class.forName(Class.java:141)
=A0 =A0 at = gastos.main(gastos.java:17)

I have tried placing the = JDBC jar file at different directories while adjusting the CLASSPATH = variable but I keep getting the same annoying error. I also tried the = -cp flag when invoking 'java' to execute the program, but it does not = work. I ran out of ideas and the exercise is becoming very frustrating. = Any suggestions will be highly appreciated. Thanks a lot in = advance.

Regards,

Enrique
= --Apple-Mail-1--366656966--