<分区>
我正在尝试连接到我的 msql 数据库,但不断收到错误消息: 找不到适合 jdbc:mysql://localhost:3306/test3 的驱动程序。
try{
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test3" , "root", "julius");
Statement statement = (Statement) con.createStatement();
String insert = "INSERT INTO testtable VALUE ('Guy' , '0156421";
statement.executeUpdate(insert);
}catch(Exception e){
System.out.println("ERROR: " + e.getMessage());
}
我没有安装任何 mysql 连接器,但是因为我可以导入 java.sql.Connection;, java.sql.DriverManager;, java.sql.Statement;我想那是不需要的。