关于mysql的驱动问题

luhaoyan 2007-12-11 09:55:39
我安装了 tomcat 5.0 与mysql5.0 分开都能正常用,打开与数据库无关的jsp页面没问题,只要打开数据库相关的jsp页面就会出现的错误

服务器端发生错误:Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** com.mysql.jdbc.CommunicationsException MESSAGE: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.io.EOFException MESSAGE: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. STACKTRACE: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997) at
错误原因为:com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** com.mysql.jdbc.CommunicationsException MESSAGE: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.io.EOFException MESSAGE: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. STACKTRACE: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.

我把mysql的jdbc驱动拷到c:\tomcat\com\lib目录下了,然后在classpath 和path中都设了该路径,我上网查了好几天资料,说是jdbc驱动的问题,我下的是5.0的驱动.源程序用的是孙卫琴的tomcat 与web开发详解中bookstore中的verse0中的.应该没问题.请高手给我指点.谢谢,我试了好多次了,都没能解决.谢谢
...全文
1088 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
luhaoyan 2007-12-12
  • 打赏
  • 举报
回复
我知道没有连接成功,就是不知道如何才能连上.各位高手看看如何才能连上.有什么问题.
懒得去死 2007-12-11
  • 打赏
  • 举报
回复
根本就没有连接成功

56,687

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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