From: Guy Rouillier <guyr-ml1@burntmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: jdbc works in java app, fails in servlet: "no suitable jdbc found"
Date: Thu, 03 Jun 2010 19:51:17 -0400
Message-ID: <4C083FF5.9090207@burntmail.com> (raw)
In-Reply-To: <4C07431A.9020506@postnewspapers.com.au>
References: <8CCD02714A2791E-E2C-7A83@webmail-m042.sysops.aol.com>
<4C05F409.7060805@postnewspapers.com.au>
<8CCD0CAC9B7220C-D8C-4F1C@webmail-d098.sysops.aol.com>
<AANLkTinG_zY7VsxYk9ESo0OZ3iYTpVt6NfuZVQh3_8fZ@mail.gmail.com>
<4C07431A.9020506@postnewspapers.com.au>
On 6/3/2010 1:52 AM, Craig Ringer wrote:
> On 3/06/2010 12:15 PM, Manohar Bhattarai wrote:
>
>> I had the same problem of getting exception of class not found as you
>> are getting. I have solved the problem by simply putting the jar file in
>> CATALINA_HOME/lib/ directory. Then i restarted Eclipse.
>> And wow the driver was found. This was solved just yesterday. See if
>> this helps you.
>
> That's usually not the best way to do it (at least in Glassfish-land)
> though, because that jar is visible to all installed apps. It gets
> complicated if different servelets require different versions of some
> libraries.
I don't know the OP's configuration, but in Tomcat a common way to
handle database connections is to use the Tomcat-provide pooling
mechanism. If this option is chosen, then you must get the appropriate
database drivers into Tomcat's bootstrap classpath. Tomcat initializes
the connection pools before starting up any of the webapps, so putting
the database JARs into a particular webapp won't work.
If you elect not to use Tomcat's database pools, then of course you can
include the database drivers in with your application. But then if you
have 3 or 4 applications using the same database, each will have its own
connection pool, which is sub-optimal.
--
Guy Rouillier
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: guyr-ml1@burntmail.com
Subject: Re: jdbc works in java app, fails in servlet: "no suitable jdbc found"
In-Reply-To: <4C083FF5.9090207@burntmail.com>
References: <8CCD02714A2791E-E2C-7A83@webmail-m042.sysops.aol.com> <4C05F409.7060805@postnewspapers.com.au> <8CCD0CAC9B7220C-D8C-4F1C@webmail-d098.sysops.aol.com> <AANLkTinG_zY7VsxYk9ESo0OZ3iYTpVt6NfuZVQh3_8fZ@mail.gmail.com> <4C07431A.9020506@postnewspapers.com.au> <4C083FF5.9090207@burntmail.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