From: Oliver Jowett <oliver@opencloud.com>
To: abdelkader belkadi <contactbelkadi@yahoo.fr>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: pgsql-jdbc and Java
Date: Thu, 04 Aug 2005 12:05:22 +1200
Message-ID: <42F15BC2.9000509@opencloud.com> (raw)
In-Reply-To: <20050803153923.33521.qmail@web25705.mail.ukl.yahoo.com>
References: <20050803153923.33521.qmail@web25705.mail.ukl.yahoo.com>
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
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: oliver@opencloud.com, contactbelkadi@yahoo.fr
Subject: Re: pgsql-jdbc and Java
In-Reply-To: <42F15BC2.9000509@opencloud.com>
References: <20050803153923.33521.qmail@web25705.mail.ukl.yahoo.com> <42F15BC2.9000509@opencloud.com>
* 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