public void userInfo2(int i,int b){
//加载数据库驱动程序
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
String dburl = "jdbc:mysql://47.99.75.226:3306/Database?&useSSL=false&serverTimezone=UTC&useUnicode=true&characterEncoding=utf8";
String sql = "Update UserInfo SET OnLneDay=? WHERE UserId=?";
Connection conn = null;
try {
conn = DriverManager.getConnection(dburl, "root", "Ccj.123456");
Statement stmt = conn.createStatement();
boolean rst = stmt.execute(sql);
while (rst) {
System.out.print("添加成功");
break;
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}