在你的JB中是否已经把这个jar配置到了Server libary中?

解决方案 »

  1.   

    说说你的MySQL的版本,另外,你的错误提示是在什么地方出来的?是在JBuilder9里面调试的时候出来的还是...?如果是在JBuilder9里面,那么把你的mysql驱动加入到project->project properties中的required libraries中
      

  2.   

    我在jb9中的配置过程入下:
    1.先将mysqy驱动拷入D:\JBuilder9\lib下,并设置classpath。
    2.Tools>Configure Libraries下新加一个mysql 并设置驱动路径。
    3.Tools>Enterprise setup下加入2设置的mysql。
    4.Tools>Database Pilot>View>Options>Drivers下新加一个Class: org.gjt.mm.mysql.Driver
    url: jdbc:mysql://localhost/test确定...
    5.File>New>选择4中建好的org.gjt.mm.mysql.Driver确定。
    6.在Database URLs里就出现了建好的jdbc:mysql://localhost/test双击弹出用户登录。将数据库的用户名和密码键入后,确定,就出现了上面的错误。
    驱动是好的。因为我在记事本里写的连接程序已经可以连接上了。JB9到底是怎么回事呀?到底是哪里设置错了?还望各位高手指教。真的很急问题一解决马上给分。UP也有分。先谢谢了。
      

  3.   

    用 winzip 打开看看你的 mm.mysql-2.0.14-bin.jar 
    里面是否 存在  org.gjt.mm.mysql.Driver?
    要不,到 mysql 下载它自己的驱动啊!
      

  4.   

    建议把驱动包添加到你的JDK配置下8,9的这个驱动配置库地板的不好~~~
      

  5.   

    Either copy the "com" and "org" subdirectories and all of their contents to anywhere you like, and put the directory holding the "com" and "org" subdirectories in your classpath, or put mysql-connector-java-[version]-bin.jar in your classpath, either by adding the FULL path to it to your CLASSPATH enviornment variable, or by copying the .jar file to $JAVA_HOME/jre/lib/ext.
      

  6.   

    因此你把包mysql-connector-java-[version]-bin.jar拷到C:\JBuilder9\jdk1.4\jre\lib\ext
    下就可以了。
      

  7.   

    我也曾经遇到这个问题,实际上你用那个class.forName("org.....");这句代码并没有加载mysql的驱动,我的解决办法是自己生成了一个Driver对象实例,然后调用他的getConnection方法就可以了,