Eclipse使用连接池时出现错误,Cannot create JDBC driver of class '' for connect URL 'null'和 Name jdbc is not bound in this Context
最近使用Eclipse使用连接池时出现错误,Cannot create JDBC driver of class '' for connect URL 'null'和javax.naming.NameNotFoundException: Name jdbc is not bound in this Context。不使用连接池连接mysql可以正常连接。 不在ECLIPSE中直接将JSP文件放在Tomcat 5.5\webapps\ROOT下使用连接池也没问题呀(我都是一样配置的)。请明白的大虾指点一二,小弟先谢了。
再说下我使用ECLIPSE3.2.1 TOMCAT5.5.9 mysql5.0
我的server.xml配置如下
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
pathname="conf/tomcat-users.xml"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
<Resource
name="jdbc/mysql"
type="javax.sql.DataSource"
password="123456"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
username="root"
url="jdbc:mysql://localhost:3306/email"
maxActive="4"/>
</GlobalNamingResources>
我的context.xml中设置
<Resource
name="jdbc/mysql"
type="javax.sql.DataSource"
password="123456"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
username="root"
url="jdbc:mysql://localhost:3306/email"
maxActive="4"/>
<ResourceLink global="jdbc/mysql" name="jdbc/mysql" type="javax.sql.DataSource"/>