Compare commits
No commits in common. 'ModifyPassword' and 'main' have entirely different histories.
ModifyPass
...
main
@ -1,27 +0,0 @@
|
||||
package database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ModifyPassword {
|
||||
public ModifyPassword() {
|
||||
}
|
||||
public static void modifypass(String user,String password) {
|
||||
Connection con = ConnectDatabasemxq.connectDB();
|
||||
|
||||
PreparedStatement preSql;
|
||||
|
||||
String sqlStr = "update usertable set password=? where user = ?";
|
||||
|
||||
try {
|
||||
preSql = con.prepareStatement(sqlStr);
|
||||
preSql.setString(1, password);
|
||||
preSql.setString(2, user);
|
||||
int ok = preSql.executeUpdate();
|
||||
|
||||
con.close();
|
||||
} catch (SQLException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue