import java.sql.*;
public class Test1 {
public static void main111(String[] args) throws Exception{
//1加载驱动
Class.forName("com.mysql.jdbc.Driver");
//2构建数据库连接
Connection conn=DriverManager.getConnection("jdbc:mysql:" +
"//110.65.81.150:3306/jn?characterEnconding=GBK",
"root","123456");
//3构建执行语句
Statement state=conn.createStatement();
String sql="update xs set xingming='ZhangSan' where xuehao=2 ";
state.execute(sql);
conn.close();
}
}