下载mysql的jdbc驱动啊~ www.mysql.com就有

解决方案 »

  1.   

    我有一个mm.mysql.2.0.4-bin.jar的驱动好像不行啊
      

  2.   

    你把这个jar放到工程里面去了吗?
    我现在用的是mysql4.0.12
    jar mm.mysql-2.0.4-bin.jar
    好象和你一样
    我用的很正常
    所以还是建议你看看你有没有把jar放到工程属性中
    最简单的办法,看你最后的war或者ear里有没有这个jar
      

  3.   

    你用的是Tomcat么
    如果是应该把JDBC驱动放到TOMCAT_HOME/common/lib目录下
    不要放在WEB-INF/lib下
    Tomcat文档有如下一段话
    DBCP uses the Jakarta-Commons Database Connection Pool. It relies on number of Jakarta-Commons componenets: Jakarta-Commons DBCP 1.0 
    Jakarta-Commons Collections 2.0 
    Jakarta-Commons Pool 1.0 
    These jar files along with your the jar file for your JDBC driver should be installed in $CATALINA_HOME/common/lib. 
    NOTE:Third Party drivers should be in jarfiles, not zipfiles. Tomcat only adds $CATALINA_HOME/common/lib/*.jar to the classpath. 
    NOTE: Do not install these jarfiles in your /WEB-INF/lib, or $JAVA_HOME/jre/lib/ext, or anywhere else. You will experience problems if you install them anyplace other than $CATALINA_HOME/common/lib.