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 8B70352A1D for ; Thu, 4 Aug 2005 05:12:15 -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 62240-02 for ; Thu, 4 Aug 2005 08:12:13 +0000 (GMT) Received: from web25706.mail.ukl.yahoo.com (web25706.mail.ukl.yahoo.com [217.12.10.178]) by svr1.postgresql.org (Postfix) with SMTP id BF36352913 for ; Thu, 4 Aug 2005 05:12:11 -0300 (ADT) Received: (qmail 37221 invoked by uid 60001); 4 Aug 2005 08:12:12 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=KAbQbch2bcG+TxEu4HAf6f3/y2k4yLMVvYYFR+lJmCBoUuHURV/fRmnMIRXSm0qVgcpvpvvUiBnbQAXx7ewQVuqAFscTTtVteYLUz8WpQY6WCSVnBsx93HG+v06Ld1MRE8aqvT+i3TO0CqNnBzegNkIJG/BWQdnVKHwY3SErIiU= ; Message-ID: <20050804081212.37219.qmail@web25706.mail.ukl.yahoo.com> Received: from [62.23.83.125] by web25706.mail.ukl.yahoo.com via HTTP; Thu, 04 Aug 2005 10:12:12 CEST Date: Thu, 4 Aug 2005 10:12:12 +0200 (CEST) From: abdelkader belkadi Subject: Re: pgsql-jdbc and Java To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org In-Reply-To: <42F15BC2.9000509@opencloud.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1783601116-1123143132=:36058" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.281 tagged_above=0 required=5 tests=AWL, HTML_20_30, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200508/28 X-Sequence-Number: 13597 --0-1783601116-1123143132=:36058 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit I stored my driver in the lib directory of the JDK. but I manually moved the driver packages in the packages tree of my IDE, and it seems to be working correctly. Thanks. Oliver Jowett a écrit : abdelkader belkadi wrote: > D:\java -jar projectpath/projectname.jar > the following error is generated: > Class not found ! > java.lang.ClassNotFoundException: org.postgresql.Driver > The error disapears if I don't call the method that connects to the > database, which means that their is no CLASSPATH problem. A ClassNotFoundException means you *do* have a classpath problem, whether you like it or not. That exception means that the JVM cannot find the PostgreSQL JDBC driver class, i.e. it's not in the classpath. Using -jar has the unexpected behaviour that it makes the JVM completely ignore any CLASSPATH environment setting. So unless projectname.jar includes the postgresql driver itself, or references it via manifest Class-Path, this isn't going to work. Try an explicit classname and classpath (that includes both the driver jar and projectname.jar) instead of using -jar. (also, doesn't the win32/dos JVM expect paths in backslash form? you've got forward slashes above) -O --------------------------------- Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez le ici ! --0-1783601116-1123143132=:36058 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit

I stored my driver in the lib directory of the JDK.

but I manually moved the driver packages in the packages tree of my IDE, and it seems to be working correctly.

Thanks.

Oliver Jowett <oliver@opencloud.com> a écrit :

abdelkader belkadi wrote:

> D:\java -jar projectpath/projectname.jar
> the following error is generated:
> Class not found !
> java.lang.ClassNotFoundException: org.postgresql.Driver

> The error disapears if I don't call the method that connects to the
> database, which means that their is no CLASSPATH problem.

A ClassNotFoundException means you *do* have a classpath problem,
whether you like it or not. That exception means that the JVM cannot
find the PostgreSQL JDBC driver class, i.e. it's not in the classpath.

Using -jar has the unexpected behaviour that it makes the JVM completely
ignore any CLASSPATH environment setting. So unless projectname.jar
includes the postgresql driver itself, or references it via manifest
Class-Path, this isn't going to work.

Try an explicit classname and classpath (t hat includes both the driver
jar and projectname.jar) instead of using -jar.

(also, doesn't the win32/dos JVM expect paths in backslash form? you've
got forward slashes above)

-O


Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici ! --0-1783601116-1123143132=:36058--