pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Xavier Poinsard <xpoinsard@free.fr>
To: abdelkader belkadi <contactbelkadi@yahoo.fr>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: pgsql-jdbc and Java
Date: Wed, 03 Aug 2005 17:55:13 +0200
Message-ID: <42F0E8E1.9070502@free.fr> (raw)
In-Reply-To: <20050803153923.33521.qmail@web25705.mail.ukl.yahoo.com>
References: <20050803153923.33521.qmail@web25705.mail.ukl.yahoo.com>

abdelkader belkadi a écrit :
> Hello,
> I developped my java project with Java NetBeans IDE,
> the code connects to a postgreSQL database using the 
> postgresql-8.1dev-400.jdbc3.jar driver, the project builds and executes 
> correctly when using the IDE, however when trying to use the DOS command 
> line as follow:
> D:\java -jar projectpath/projectname.jar
> the following error is generated:
> Class not found !
> java.lang.ClassNotFoundException: org.postgresql.Driver
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Unknown Source)
>         at logfilerewriter.Main.connectDb(Main.java:235)
>         at logfilerewriter.Main.main(Main.java:45)
> I checked the class path, it is correctly set.
> The error disapears if I don't call the method that connects to the 
> database, which means that their is no CLASSPATH problem.

No, it means that there is a class path problem.
Could you triple check your CLASSPATH ?
What if you add " -cp path_to_postgresqldriver.jar " to your command line ?






view thread (4+ messages)  latest in thread

Message-ID: <42F0E8E1.9070502@free.fr>
Permalink:  ../42F0E8E1.9070502@free.fr/
Also on:    postgresql.org/message-id/42F0E8E1.9070502@free.fr

 · 

reply

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: xpoinsard@free.fr, contactbelkadi@yahoo.fr
  Subject: Re: pgsql-jdbc and Java
  In-Reply-To: <42F0E8E1.9070502@free.fr>
  References: <20050803153923.33521.qmail@web25705.mail.ukl.yahoo.com> <42F0E8E1.9070502@free.fr>

* 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