shobeirF
جمعه 13 اردیبهشت 1392, 13:00 عصر
من در eclipse به ارور زیر برخوردم
کسی رفع این مشکل رو بلده ؟
java.lang.classnotfoundexception com.mysql.jdbc.driver
try {
//Loading the JDBC driver for MySql
Class.forName("com.mysql.jdbc.Driver");
//Getting a connection to the database. Change the URL parameters
connection = DriverManager.getConnection("jdbc:mysql://localhost/acc", "root", "");
//Creating a statement object
Statement stmt = connection.createStatement();
//Executing the query and getting the result set
ResultSet rs = stmt.executeQuery("SELECT * FROM table1");
//Iterating the resultset and printing the 3rd column
while (rs.next()) {
txt1.setText(rs.getString(1));
}
//close the resultset, statement and connection.
rs.close();
stmt.close();
connection.close();
} catch (SQLException e) {
txt1.setText(e.toString());
} catch (ClassNotFoundException e) {
txt1.setText(e.toString());
}
کسی رفع این مشکل رو بلده ؟
java.lang.classnotfoundexception com.mysql.jdbc.driver
try {
//Loading the JDBC driver for MySql
Class.forName("com.mysql.jdbc.Driver");
//Getting a connection to the database. Change the URL parameters
connection = DriverManager.getConnection("jdbc:mysql://localhost/acc", "root", "");
//Creating a statement object
Statement stmt = connection.createStatement();
//Executing the query and getting the result set
ResultSet rs = stmt.executeQuery("SELECT * FROM table1");
//Iterating the resultset and printing the 3rd column
while (rs.next()) {
txt1.setText(rs.getString(1));
}
//close the resultset, statement and connection.
rs.close();
stmt.close();
connection.close();
} catch (SQLException e) {
txt1.setText(e.toString());
} catch (ClassNotFoundException e) {
txt1.setText(e.toString());
}