错误代码:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'.
错误原因:
由于程序在执行时不能创建连接池.
解决方法
1.在Tomcat 5.0.30中
打开tomcat/conf/server.xml,找到,并在中写入:



type="javax.sql.DataSource"/>



factory
org.apache.commons.dbcp.BasicDataSourceFactory


driverClassName
org.gjt.mm.mysql.Driver


url
jdbc:mysql://localhost:3306/appfuse


username
root


password



maxActive
20


maxIdle
10


maxWait
-1




这样就可以了.

2.在Tomcat5.5.9中
同样在中写入:

prefix="myapp." suffix=".log" timestamp="true"/>
username="test"
password="test"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/appfuse?autoReconnect=true"
maxActive="30"
maxIdle="5"
maxWait="50"
minEvictableIdleTimeMillis="4000"
timeBetweenEvictionRunsMillis="5000"
/>


就能够解决问题了.

0 Comments:

Post a Comment



 
Copyright 2005-2007. Hello Wiki designed by Fen, Blogger Templates by Blogcrowds.