mysql java no suitable driver

后端 未结 3 1646
傲寒
傲寒 2021-01-28 04:44

\"enterIn the following code..I am getting no suitable driver..error: please help. I have been wo

相关标签:
3条回答
  • 2021-01-28 05:11

    Make sure the MySQL Connector/J driver jar file is in your classpath.

    0 讨论(0)
  • 2021-01-28 05:29

    You haven't yet load the Driver to your application,try to add Class.forName("com.mysql.jdbc.Driver");

    0 讨论(0)
  • 2021-01-28 05:32

    You need to load the driver. There are a few examples in the doc that comes with the connector-j driver from sun's webpage. The following is a snippet of that document.

     try {
        Class.forName("com.mysql.jdbc.Driver").newInstance();
      } catch (Exception ex) {
         // handle the error
      }
    

    If you want to know more about loading the java jdbc driver look at chapter 6 of the connector-j.pdf that was bundled with your driver download.

    0 讨论(0)
提交回复
热议问题