ClassNotFoundException (org.postgresql.Driver) with an example join

I use the code example found here to implement Connection Pooling for my webapp: http://tomcat.apache.org/tomcat-7.0-doc/JDBC-pool.html # Plain_Ol'_Java

Since I use PostgreSQL as my database, I changed the line in which p.setDriverClassName("com.mysql.jdbc.Driver");- p.setDriverClassName("org.postgresql.Driver");.

All I get is a ClassNotFoundException. Where am I wrong? Is there another way?

EDIT: If I do not use the connection pool and do not make the usual path, I do not get an error.

EDIT 2: This is not a duplicate of the proposed question. I use Eclipse and have a jar included in the assembly assembly and deployment assembly. As I said, an error does not occur when pooling is NOT performed and the connection is simply opened manually and closed.

+4
source share
1 answer

Tomcat 7 expects to find the JAR JAR driver in its / lib folder. If you put them in your WEB-INF / lib folder context, it will not find them and you will receive an error message.

, "", , , JAR. Tomcat , .

+5

All Articles