Re: stupid question about loading driver

From: "Paul Stead" <pstead(at)elementallogic(dot)com>
To: "PostgreSQL JDBC List" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: stupid question about loading driver
Date: 2003-01-19 18:19:58
Message-ID: BNENLMOEFCOIEGKDJMLLCEABCFAA.pstead@elementallogic.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

.....My first reply rejected by the list.....

With stand-alone Java apps using the -jar I found any classpath passed in
was totally ignored and you *had* to pass them in via the manifest. For
example, our e-mail server program has the following as the manifest:

Main-Class: com.envoysoftware.serverMain.emailenvoy
Class-Path: mail.jar activation.jar devpgjdbc2.jar

This is the ONLY way it would find the additional jar files UNLESS we put
them in the ext dir of the java distribution (i.e.
/path_to_java/jre/lib/ext/). Note that you put the jar file names in the
manifest, NOT "org.postgresql.Driver". Our jar files are in the same
directory as the main application, so we don't have full path names to them,
but I presume you'd need full paths if it wasn't there.

Hope this helps....it took me a day of pure frustration to figure this out!!
The Java documentation is NOT clear about this little tidbit on using
the -jar call.

cheers,
Paul

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Richard Welty
Sent: Sunday, January 19, 2003 8:20 AM
To: PostgreSQL JDBC List
Subject: Re: [JDBC] stupid question about loading driver

On 19 Jan 2003 10:14:27 -0500 Dave Cramer <Dave(at)micro-automation(dot)net> wrote:
> Everything does look right here, so the only possibility that I can
> think of is that the jar is spelled wrong, or isn't where you are saying
> it is?

i cut and pasted it out of the classpath into an ls command, and the path
is correct.

this is my first cut at using ant and the jar builder tools, and i don't
know for a fact that i got the manifest.mf file right:

--cut here--
Manifest-Version: 0.1
Signature-Version: 0.1
Main-Class: com.example.foo.exampleFooApp
--cut here--

is the trivial one i'm using, modulo the obfuscation required by my NDA.

i had a classpath: entry in there, but removed it, it doesn't seem to make
a difference if it's there or not, but the documentation i went through is
mildly unclear about what form a classpath: entry in an manifest is
supposed to look like. should i have something like:

Classpath: org.postgresql.Driver

which is what i had before, or something else, or nothing at all? i can't
believe that they would want me to hardcode paths in the local file system
in to the manifest for a theoretically portable jar file.

richard
--
Richard Welty rwelty(at)averillpark(dot)net
Averill Park Networking 518-573-7592
Unix, Linux, IP Network Engineering, Security

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message michel verplancke 2003-01-19 19:03:31 jdbc connection
Previous Message Paul Stead 2003-01-19 18:14:13 Re: stupid question about loading driver