Thread: Problem wih JDBC driver under Windows XP
Hi all! I've some problems in connecting to postgreSQL with the JDBC driver from my JSP page. I've installed PostgreSQL for Windows, ver. 7.1.2, so I took on the site the pg72jdbc2.jar file as JDBC driver. Then I followed all the steps in the documentation at the URL http://jdbc.postgresql.org/doc.html. Because i need to use the jdbc driver with Java Server Pages, I didn't use the classpath method, but I copyed the driver directly in the lib/ext directory in my JVM path. I can connect to the DB with PgAdmin 2, but when I try to connect from my JSP page, the Tomcat WebServer says: "java.lang.ClassNotFoundException: org.postgresql.Driver" What did I forget??? Thanks, Luca. | |||
Well keeping the .jar file under WEB-INF/lib folder for that application works for me in tomcat.
-----Original Message-----
From: Luca Di Mauro [mailto:lucadima@email.it]
Sent: 02 February 2004 09:58
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] Problem wih JDBC driver under Windows XP
From: Luca Di Mauro [mailto:lucadima@email.it]
Sent: 02 February 2004 09:58
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] Problem wih JDBC driver under Windows XP
Hi all! I've some problems in connecting to postgreSQL with the JDBC driver from my JSP page. I've installed PostgreSQL for Windows, ver. 7.1.2, so I took on the site the pg72jdbc2.jar file as JDBC driver. Then I followed all the steps in the documentation at the URL http://jdbc.postgresql.org/doc.html. Because i need to use the jdbc driver with Java Server Pages, I didn't use the classpath method, but I copyed the driver directly in the lib/ext directory in my JVM path. I can connect to the DB with PgAdmin 2, but when I try to connect from my JSP page, the Tomcat WebServer says: "java.lang.ClassNotFoundException: org.postgresql.Driver" What did I forget??? Thanks, Luca. | |||
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
On 02/02/2004 10:04 Bhushan Bhangale wrote: > Well keeping the .jar file under WEB-INF/lib folder for that application > works for me in tomcat. Whilst that will work, the recommended location for JDBC drivers is common/lib. -- Paul Thomas +------------------------------+---------------------------------------------+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+---------------------------------------------+
Paul, Actually, according to the doc's for Tomcat, it won't work if you use tomcat's data sources. The driver has to be in $CATALINA_HOME/common/lib Dave On Mon, 2004-02-02 at 05:58, Paul Thomas wrote: > On 02/02/2004 10:04 Bhushan Bhangale wrote: > > Well keeping the .jar file under WEB-INF/lib folder for that application > > works for me in tomcat. > > Whilst that will work, the recommended location for JDBC drivers is > common/lib. -- Dave Cramer 519 939 0336 ICQ # 14675561
On 02/02/2004 11:51 Dave Cramer wrote: > Paul, > > Actually, according to the doc's for Tomcat, it won't work if you use > tomcat's data sources. The driver has to be in $CATALINA_HOME/common/lib Good point. -- Paul Thomas +------------------------------+---------------------------------------------+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+---------------------------------------------+
I keep jar files -> 1. specific to a application in WEB-INF/lib 2. shared across applications deployed in same tomcat in shared/lib 3. common to tomcat and applications in common/lib Thanks Bhushan -----Original Message----- From: Paul Thomas [mailto:paul@tmsl.demon.co.uk] Sent: 02 February 2004 16:24 To: pg@fastcrypt.com Cc: pgsql-jdbc@postgresql.org Subject: Re: [JDBC] Problem wih JDBC driver under Windows XP On 02/02/2004 11:51 Dave Cramer wrote: > Paul, > > Actually, according to the doc's for Tomcat, it won't work if you use > tomcat's data sources. The driver has to be in $CATALINA_HOME/common/lib Good point. -- Paul Thomas +------------------------------+-------------------------------------------- -+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+-------------------------------------------- -+ ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________