This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Hi , I am having a problem in creating the Connection Pool for Tomcat. I have created the Data Source through the Admin interface in the Tomcat Server. I am getting the DataSource Object. But when getting the Connection Object by using getConnection() Method I am getting the following exception .
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class ' org.postgresql.Driver' for connect URL 'jdbc ostgresql//192.168.0.53/xtend', ca use: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getDriver(DriverManager.java:243) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:743) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:518)
i am using postgresql7.3.2 . I have placed the JDBC Driver jar file in the server\common\lib directory . From the error message it seems that Tomcat is not able to load the corresponding jar file of the JDBC Driver. Can any one help me in solving the problem
Content of the server.xml file regarding the Context is as follows
The jar containing the driver should be in the /WEB-INF/lib of your application, or common/lib of tomcat.
If that doesn't work, it may be that jar's internal structure is incorrect. Rename it to zip, open and make sure things are where they should be. Finally, double check the fully qualified class name.
Joined: Nov 02, 2004
As per your suggestion i have made the necessary changes of renaming the file but still there is some error when i am calling the servlet
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver', cause: java.lang.ClassNotFoundException: org.postgresql.Driver at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClas sLoader.java:945) at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClas sLoader.java:810) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:140) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:730) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:518)
well the good thing i am noticing is that error message is diff from the previous one.