JNDI连接mysql出错

yonhudenglunicheng 2011-07-14 10:10:42
大家好:

我用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感觉没有什么问题,很困惑,希望大家能指点迷津?
...全文
286 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

51,409

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧