JNDI连接mysql出错
大家好:
我用JDNI连接Mysql,配置的context.xml如下
<?xml version='1.0' encoding='utf-8'?>
<Context debug="5" reloadable="true" crossContext="true">
<Resource name="DB"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="4"
maxWait="5000"
username="root"
password="root"
url="jdbc:mysql://localhost:3306/tree?AutoReconnect=true"
maxActive="4"
/>
</Context>
报了下列错误
Cannot create PoolableConnectionFactory (Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "3306:tree"'.)
和
Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "3306:tree"'.
和
Cannot create PoolableConnectionFactory (Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "3306:tree"'.)
说是输入的字符串有问题,但看看context.xml感觉没有什么问题,很困惑,希望大家能指点迷津?