修复所有数据库性能问题
This commit is contained in:
@@ -26,9 +26,7 @@
|
||||
String pass = request.getParameter("inputPassword");
|
||||
String phone = request.getParameter("PhoneNumber");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
|
||||
|
||||
%>
|
||||
|
||||
@@ -38,6 +36,10 @@
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
try{
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
conn = DriverManager.getConnection(url, use, password);
|
||||
sql = conn.prepareStatement("select * from user where userName=? and Email=? and phoneNum=?");
|
||||
sql.setString(1, users);
|
||||
@@ -47,6 +49,12 @@
|
||||
if (rs.next()) {
|
||||
flag = true;
|
||||
}
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是正确的登录用户 -->
|
||||
<%
|
||||
@@ -58,9 +66,7 @@
|
||||
} else if (flag == false) {
|
||||
out.println("<script language=javascript>alert('邮箱或手机输入有误,修改失败');window.location.href='index.html'</script>");
|
||||
}
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user