public class jdbclianxi {
public static void main(String[] args) throws Exception {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://127.0.0.1:3306/db1";
String username = "root";
String password = "123wang";
Connection con = DriverManager.getConnection(url,username,password);
String sql = "UPDATE lianxi set money = 2000 where id = 1";
Statement statement = (Statement) con.createStatement();
statement.executeUpdate(sql);
}
}
It will be displayed in the idea that the way of executeUpdate cannot be found
So what can i do? When I encounter this situation
New contributor
Wangzy233 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.