0
私はmysql-connector-java-5.1.19.jarを追加しましたが、なぜエラーが発生しているのか分かりません。 driver is imported as shown in the imageEclipse Javaのエラー:java.lang.ClassNotFoundException:com.mysql.jdbc.driver
public class data {
String server = "jdbc:mysql://localhost/";
String user = "root";
String pass = "toor";
public int starting() {
int id;
try {
Class.forName("com.mysql.jdbc.driver");
Connection incre = (Connection) DriverManager.getConnection("inc"+server, user, pass);
Statement statement = (Statement) incre.createStatement();
String select = "Select start from incr;";
ResultSet rs = (ResultSet) statement.executeQuery(select);
if(rs.next()){
id = rs.getInt("start");
}
incre.close();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
「driver」は「Driver」 –