Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id AD540632EF4 for ; Wed, 2 Jun 2010 01:56:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 48221-04 for ; Wed, 2 Jun 2010 04:56:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from imr-ma06.mx.aol.com (imr-ma06.mx.aol.com [64.12.78.142]) by mail.postgresql.org (Postfix) with ESMTP id 91AF5632D37 for ; Wed, 2 Jun 2010 01:56:41 -0300 (ADT) Received: from imo-ma04.mx.aol.com (imo-ma04.mx.aol.com [64.12.78.139]) by imr-ma06.mx.aol.com (8.14.1/8.14.1) with ESMTP id o524uUPQ009569 for ; Wed, 2 Jun 2010 00:56:30 -0400 Received: from PhilFrei@aol.com by imo-ma04.mx.aol.com (mail_out_v42.9.) id k.e37.12d2e0f (43813) for ; Wed, 2 Jun 2010 00:56:25 -0400 (EDT) Received: from smtprly-me03.mx.aol.com (smtprly-me03.mx.aol.com [64.12.95.104]) by cia-dc01.mx.aol.com (v129.4) with ESMTP id MAILCIADC012-b30c4c05e475102; Wed, 02 Jun 2010 00:56:25 -0400 Received: from webmail-m042 (webmail-m042.sim.aol.com [64.12.101.225]) by smtprly-me03.mx.aol.com (v129.4) with ESMTP id MAILSMTPRLYME034-b30c4c05e475102; Wed, 02 Jun 2010 00:56:21 -0400 To: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: quoted-printable Subject: jdbc works in java app, fails in servlet: "no suitable jdbc found" Date: Wed, 02 Jun 2010 00:56:22 -0400 X-MB-Message-Source: WebUI X-AOL-IP: 69.228.200.66 X-MB-Message-Type: User MIME-Version: 1.0 From: philfrei@aol.com Content-Type: text/plain; charset="us-ascii"; format=flowed X-Mailer: AOL Webmail 31793-STANDARD Received: from 69.228.200.66 by webmail-m042.sysops.aol.com (64.12.101.225) with HTTP (WebMailUI); Wed, 02 Jun 2010 00:56:22 -0400 Message-Id: <8CCD02714A2791E-E2C-7A83@webmail-m042.sysops.aol.com> X-AOL-SENDER: PhilFrei@aol.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-10 required=5 tests=BAYES_50=0.8, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/12 X-Sequence-Number: 20582 Hi - I am new to Postgresql (and Eclipse and Tomcat--triple threat),and=20 would have posted this question in the general section, but thought it=20 might be more appropriate here since it concerns the JDCB. I have successfully installed and run some example programs from Core=20 Java II by Horstmann. I wish to connect to a database from a Java=20 Servlet, and tried using the same code and properties as is being used=20 in a Java application program (which successfully connects to the same=20 db), but am getting the following error when executing the=20 DriverManager.getConnection(url, username, password) code: java.sql.SQLException: No suitable driver found for=20 jdbc:postgresql:gpsdata Is a different driver needed in the "Servlet" context? I've done=20 everything I can think of to make the Java Application which works and=20 the Java Servlet which fails as similar as possible, down to hardcoding=20 them both to the same "database.properties" text file. This file=20 contains the following data: jdbc.url=3Djdbc:postgresql:gpsdata jdbc.password=3D******** jdbc.username=3Dpostgres jdbc.drivers=3Dorg.postgresql.Driver If I understand correctly, the third parameter of the URL defaults to=20 //localhost:5432/gpsdata, which I can confirm is the location given by=20 inspection in pgAdmin III. I've tried writing out the full url, and=20 gone so far as to make sure everything is lowercase. But as I said, the=20 same connection that will work in a Java application will not work in=20 the servlet context. In researching your archives, I came across another individual with the=20 "no suitable driver" problem. His closing comments included this: >>The problem had nothing to do with it being a web application=20 (because you don't have to deploy it to generate a database schema) but=20 you did put me onto the right train of thought. The problem was that=20 although I had added the postgresql jdbc driver to my maven project as=20 a dependency, I hadn't added it as a dependency for the=20 hibernate3-maven-plugin.<< But I'm not sure how I can apply that (I'm not using Maven, etc.),=20 except to ask if there are dependancies I am overlooking? Is there,=20 perhaps, something in the configuration of Apache that might be=20 omitted? Something I'm supposed to put in the web.xml file? In both the=20 application and the servlet, the jdbc is connected as a library, via=20 Eclipse's "Data Management/Connectivity/Driver Definitions" section of=20 the preferences. And if one right-click's and selects the properties of=20 the connected library in each project, the library is designated as a=20 "Connectivity Driver Definition". jdbc I am using: postgresql-8.4-701.jdbc4.jar Many thanks in advance for any assistance!