Skip site navigation (1) Skip section navigation (2)

Re: Problems loading the driver

From: Enrique Ibarra <enrique(dot)ibarra(at)mac(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problems loading the driver
Date: 2005-06-27 18:22:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Oliver, thank you very much for your quick response. It seems that I  
will have to check this problem with Apple support. The jar driver is  
in fact in the CLASSPATH variable but somehow its value is not being  
correctly read by java. I was originally working with Xcode (Apple's  
IDE). I tried specifying both the CLASSPATH environment variable and  
java's -cp switch in the IDE but it did not work. Then I switched to  
old-fashioned emacs and a command terminal and I was able to make the  
program run, but only when I specify the -cp option in the java  
command line. If I do not specify the -cp switch then the program  
does not run (even though the jar driver is in the CLASSPATH). I have  
not been able to make this program run from the Xcode IDE. Here is  
the output of the command terminal to illustrate this problem. Thanks  

{~/Ixe/Proyectos/tarme}% javac
{~/Ixe/Proyectos/tarme}% echo $CLASSPATH
{~/Ixe/Proyectos/tarme}% java actgastos gastos.csv
java.lang.ClassNotFoundException: org.postgresql.Driver
         at Method)
         at java.lang.ClassLoader.loadClass(
         at sun.misc.Launcher$AppClassLoader.loadClass( 
         at java.lang.ClassLoader.loadClass(
         at java.lang.ClassLoader.loadClassInternal( 
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(
         at actgastos.main(
No suitable driver
java.sql.SQLException: No suitable driver
         at java.sql.DriverManager.getConnection(
         at java.sql.DriverManager.getConnection(
         at actgastos.main(
{~/Ixe/Proyectos/tarme}% java -cp /usr/local/lib/postgresql.jar:.:  
actgastos gastos.csv

On Jun 25, 2005, at 12:22 AM, Oliver Jowett wrote:

> enrique(dot)ibarra(at)mac(dot)com wrote:
>> The JDBC jar file IS in the CLASSPATH environment variable. The  
>> code of
>> the program is the following:
>> org.postgresql.Driver
>> java.lang.ClassNotFoundException: org.postgresql.Driver
> This means that the driver jar *isn't* in your classpath.
> What is the exact value of your CLASSPATH, have you exported the
> CLASSPATH environment variable, where have you placed the driver jar,
> and what is the Java command line you are trying?
> -O

In response to

pgsql-jdbc by date

Next:From: Jesper ThorhaugeDate: 2005-06-28 08:15:31
Subject: getBinaryStream and OutOfMemoryException
Previous:From: Csaba NagyDate: 2005-06-27 12:06:18
Subject: [PATCH]Re: Which version of driver to use ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group