Re: a little disillusioned - Mailing list pgsql-jdbc

From Paul Thomas
Subject Re: a little disillusioned
Date
Msg-id 20040121082825.A14300@bacon
Whole thread Raw
In response to a little disillusioned  ("Frequency UnKnown" <captainmofopants@hotmail.com>)
List pgsql-jdbc
On 21/01/2004 05:12 Frequency UnKnown wrote:
> well, my ploy failed. having never got a decent answer from any
> technical forum, i had to try.
>
> so back to the tried and tested method:
>
> can anyone explain to me why tomcat 5 will not find
> org.postgresql.Driver when it is definitely there?
>
> i know this is a very broad question but i have covered the obvious
> things like class path and such (which, i might add, is the worst part
> of Java invented). the only thing that seems to work for me is to
> extract the contents of the .JAR file into my $JAVAHOME. surely this is
> NOT the way to do it - otherwise the package wouldn't even come as a
> JAR. in fact, i've got plenty of other JARs working, such as the
> SmartUploader, SOAP handlers and the like.
>
> So what's the difference between me directly instantiating a class
> (which it seems i can do) and calling Class.forName()/createInstance()
> (or whatever it is) in terms of where Java looks for classes? as i said,
> the classpath for my system, for java, and for tomcat are all pointed to
> the place where I have put the JAR.

Stay away from classpaths with Tomcat - it uses its own class loaders and
you can really confuse it if you have your jar in the classpath too. What
I do (on Tomcat 4.1) is put the driver in common/lib and use connection
pooling via JNDI (if you do this _do not_ include the driver in your app
as well). Have you tried this approach? Have you tried running your app
under Tomcat 4.1?

> i'm running debian, if that helps.

IMHO, running anything other than M$ helps ;)

> PS: i will go elsewhere if i am in the wrong place too. is there a forum
> more related to my topic?

Maybe the Tomcat people could help?

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

pgsql-jdbc by date:

Previous
From: Guido Fiala
Date:
Subject: Re: updatable resultsets -> SQLException: -1
Next
From: Kris Jurka
Date:
Subject: Re: updatable resultsets -> SQLException: -1