mysql java no suitable driver

后端 未结 3 1645
傲寒
傲寒 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: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.

提交回复
热议问题