Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 766756329C3 for ; Thu, 3 Jun 2010 20:51:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 74153-05 for ; Thu, 3 Jun 2010 23:51:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx02.burntmail.com (mx02.burntmail.com [70.87.63.122]) by mail.postgresql.org (Postfix) with ESMTP id 212EC63248E for ; Thu, 3 Jun 2010 20:51:26 -0300 (ADT) Received: from [64.47.45.241] (helo=[64.47.104.184]) by mx02.burntmail.com with esmtpa (Exim 4.63) (envelope-from ) id 1OKKC4-0005fd-CG for pgsql-jdbc@postgresql.org; Thu, 03 Jun 2010 18:51:24 -0500 Message-ID: <4C083FF5.9090207@burntmail.com> Date: Thu, 03 Jun 2010 19:51:17 -0400 From: Guy Rouillier User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: jdbc works in java app, fails in servlet: "no suitable jdbc found" References: <8CCD02714A2791E-E2C-7A83@webmail-m042.sysops.aol.com> <4C05F409.7060805@postnewspapers.com.au> <8CCD0CAC9B7220C-D8C-4F1C@webmail-d098.sysops.aol.com> <4C07431A.9020506@postnewspapers.com.au> In-Reply-To: <4C07431A.9020506@postnewspapers.com.au> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/37 X-Sequence-Number: 20607 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