IDEA代码如下
```javascript
package Daima;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Connection;
//后端开发
public class hou {
// private static Object conn;//报错添加
public static void main(String[] args) throws ClassNotFoundException, SQLException {
Class.forName("com.mysql.cj.jdbc.Driver");
String sul="jdbc:mysql://10.33.60.21:3306/db1011";
String user="root";
String password="123456";
Connection conn=DriverManager.getConnection(sul,user,password);
String sql="update account set didian = '南宁' where firm = '微信'";
Statement stmt = conn.createStatement();
int count = stmt.executeUpdate(sql);
stmt.close();
conn.close();
}
}
代码中数据库已经创建,数据库后台正常启动
在IDEA运行代码URL位置报错