修复所有数据库性能问题
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn = DriverManager.getConnection(url, use, password);
|
Connection conn = DriverManager.getConnection(url, use, password);
|
||||||
PreparedStatement sql = conn
|
PreparedStatement sql = conn
|
||||||
.prepareStatement("delete from adminstrator_record where AdminName=?");
|
.prepareStatement("delete from adminstrator_record where AdminName=?");
|
||||||
@@ -47,6 +48,9 @@
|
|||||||
}
|
}
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
}catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是插入成功 -->
|
<!-- 判断是否是插入成功 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn = DriverManager.getConnection(url, use, password);
|
Connection conn = DriverManager.getConnection(url, use, password);
|
||||||
PreparedStatement sql = conn
|
PreparedStatement sql = conn
|
||||||
.prepareStatement("insert into adminstrator_record(AdminNo,AdminName,Adminsex,Adminjob)values(?,?,?,?)");
|
.prepareStatement("insert into adminstrator_record(AdminNo,AdminName,Adminsex,Adminjob)values(?,?,?,?)");
|
||||||
@@ -52,6 +53,9 @@
|
|||||||
}
|
}
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
}catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是插入成功 -->
|
<!-- 判断是否是插入成功 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn = DriverManager.getConnection(url, use, password);
|
Connection conn = DriverManager.getConnection(url, use, password);
|
||||||
PreparedStatement sql = conn
|
PreparedStatement sql = conn
|
||||||
.prepareStatement("update adminstrator_record set AdminNo=?,AdminSex=?,AdminJob=? where AdminName=?");
|
.prepareStatement("update adminstrator_record set AdminNo=?,AdminSex=?,AdminJob=? where AdminName=?");
|
||||||
@@ -52,6 +53,9 @@
|
|||||||
}
|
}
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
}catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是插入成功 -->
|
<!-- 判断是否是插入成功 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn = DriverManager.getConnection(url, use, password);
|
Connection conn = DriverManager.getConnection(url, use, password);
|
||||||
PreparedStatement sql = conn
|
PreparedStatement sql = conn
|
||||||
.prepareStatement("delete from administrator_job where AdminJob=?");
|
.prepareStatement("delete from administrator_job where AdminJob=?");
|
||||||
@@ -47,6 +48,9 @@
|
|||||||
}
|
}
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是插入成功 -->
|
<!-- 判断是否是插入成功 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn = DriverManager.getConnection(url, use, password);
|
Connection conn = DriverManager.getConnection(url, use, password);
|
||||||
PreparedStatement sql = conn
|
PreparedStatement sql = conn
|
||||||
.prepareStatement("insert into administrator_job(AdminJob,AdminDuty)values(?,?)");
|
.prepareStatement("insert into administrator_job(AdminJob,AdminDuty)values(?,?)");
|
||||||
@@ -48,6 +49,9 @@
|
|||||||
}
|
}
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是插入成功 -->
|
<!-- 判断是否是插入成功 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn= DriverManager.getConnection(url,use,password);
|
Connection conn= DriverManager.getConnection(url,use,password);
|
||||||
PreparedStatement sql =conn.prepareStatement("update user set password=? where userName=?");
|
PreparedStatement sql =conn.prepareStatement("update user set password=? where userName=?");
|
||||||
sql.setString(1,pass);
|
sql.setString(1,pass);
|
||||||
@@ -41,6 +42,9 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
|
|||||||
int rtn=sql.executeUpdate();
|
int rtn=sql.executeUpdate();
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
out.println("<script language=javascript>alert('修改成功!');window.location.href='index.html'</script>");
|
out.println("<script language=javascript>alert('修改成功!');window.location.href='index.html'</script>");
|
||||||
|
|||||||
@@ -26,9 +26,7 @@
|
|||||||
String pass = request.getParameter("inputPassword");
|
String pass = request.getParameter("inputPassword");
|
||||||
String phone = request.getParameter("PhoneNumber");
|
String phone = request.getParameter("PhoneNumber");
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
PreparedStatement sql = null;
|
|
||||||
ResultSet rs = null;
|
|
||||||
Connection conn = null;
|
|
||||||
|
|
||||||
%>
|
%>
|
||||||
|
|
||||||
@@ -38,6 +36,10 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
|
PreparedStatement sql = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
Connection conn = null;
|
||||||
conn = DriverManager.getConnection(url, use, password);
|
conn = DriverManager.getConnection(url, use, password);
|
||||||
sql = conn.prepareStatement("select * from user where userName=? and Email=? and phoneNum=?");
|
sql = conn.prepareStatement("select * from user where userName=? and Email=? and phoneNum=?");
|
||||||
sql.setString(1, users);
|
sql.setString(1, users);
|
||||||
@@ -47,6 +49,12 @@
|
|||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
|
rs.close();
|
||||||
|
sql.close();
|
||||||
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是正确的登录用户 -->
|
<!-- 判断是否是正确的登录用户 -->
|
||||||
<%
|
<%
|
||||||
@@ -58,9 +66,7 @@
|
|||||||
} else if (flag == false) {
|
} else if (flag == false) {
|
||||||
out.println("<script language=javascript>alert('邮箱或手机输入有误,修改失败');window.location.href='index.html'</script>");
|
out.println("<script language=javascript>alert('邮箱或手机输入有误,修改失败');window.location.href='index.html'</script>");
|
||||||
}
|
}
|
||||||
rs.close();
|
|
||||||
sql.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn = DriverManager.getConnection(url, use, password);
|
Connection conn = DriverManager.getConnection(url, use, password);
|
||||||
PreparedStatement sql = conn
|
PreparedStatement sql = conn
|
||||||
.prepareStatement("delete from administrator_job where AdminJob=?");
|
.prepareStatement("delete from administrator_job where AdminJob=?");
|
||||||
@@ -47,6 +48,9 @@
|
|||||||
}
|
}
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是插入成功 -->
|
<!-- 判断是否是插入成功 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -23,9 +23,7 @@
|
|||||||
<%
|
<%
|
||||||
request.setCharacterEncoding("utf-8");
|
request.setCharacterEncoding("utf-8");
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
PreparedStatement sql = null;
|
|
||||||
ResultSet rs = null;
|
|
||||||
Connection conn = null;
|
|
||||||
if (session.getAttribute("actualuser") == null) {
|
if (session.getAttribute("actualuser") == null) {
|
||||||
out.println(
|
out.println(
|
||||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||||
@@ -41,6 +39,10 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
|
PreparedStatement sql = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
Connection conn = null;
|
||||||
conn = DriverManager.getConnection(url, use, password);
|
conn = DriverManager.getConnection(url, use, password);
|
||||||
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
|
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
|
||||||
sql.setString(1, users);
|
sql.setString(1, users);
|
||||||
@@ -51,6 +53,9 @@
|
|||||||
rs.close();
|
rs.close();
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是管理员 -->
|
<!-- 判断是否是管理员 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -23,9 +23,7 @@
|
|||||||
<%
|
<%
|
||||||
request.setCharacterEncoding("utf-8");
|
request.setCharacterEncoding("utf-8");
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
PreparedStatement sql = null;
|
|
||||||
ResultSet rs = null;
|
|
||||||
Connection conn = null;
|
|
||||||
if (session.getAttribute("actualuser") == null) {
|
if (session.getAttribute("actualuser") == null) {
|
||||||
out.println(
|
out.println(
|
||||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||||
@@ -41,6 +39,10 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
|
PreparedStatement sql = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
Connection conn = null;
|
||||||
conn = DriverManager.getConnection(url, use, password);
|
conn = DriverManager.getConnection(url, use, password);
|
||||||
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
|
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
|
||||||
sql.setString(1, users);
|
sql.setString(1, users);
|
||||||
@@ -51,6 +53,10 @@
|
|||||||
rs.close();
|
rs.close();
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是管理员 -->
|
<!-- 判断是否是管理员 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -23,9 +23,7 @@
|
|||||||
<%
|
<%
|
||||||
request.setCharacterEncoding("utf-8");
|
request.setCharacterEncoding("utf-8");
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
PreparedStatement sql = null;
|
|
||||||
ResultSet rs = null;
|
|
||||||
Connection conn = null;
|
|
||||||
if (session.getAttribute("actualuser") == null) {
|
if (session.getAttribute("actualuser") == null) {
|
||||||
out.println(
|
out.println(
|
||||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||||
@@ -41,6 +39,10 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
|
PreparedStatement sql = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
Connection conn = null;
|
||||||
conn = DriverManager.getConnection(url, use, password);
|
conn = DriverManager.getConnection(url, use, password);
|
||||||
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
|
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
|
||||||
sql.setString(1, users);
|
sql.setString(1, users);
|
||||||
@@ -51,6 +53,9 @@
|
|||||||
rs.close();
|
rs.close();
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是管理员 -->
|
<!-- 判断是否是管理员 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
PreparedStatement vipsql = null;
|
PreparedStatement vipsql = null;
|
||||||
ResultSet viprs = null;
|
ResultSet viprs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
|
conn = DriverManager.getConnection(url, use, password);
|
||||||
vipsql = conn.prepareStatement(
|
vipsql = conn.prepareStatement(
|
||||||
"select userName,case when VIP = 1 then 'VIP用户' else '普通用户' end as VIP,case when Administrator = 1 then '管理员' else '' end as Administrator from show_user where userName=?");
|
"select userName,case when VIP = 1 then 'VIP用户' else '普通用户' end as VIP,case when Administrator = 1 then '管理员' else '' end as Administrator from show_user where userName=?");
|
||||||
vipsql.setString(1, users);
|
vipsql.setString(1, users);
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<%@ page language="java" import="java.util.*"
|
<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%>
|
||||||
contentType="text/html;charset=utf-8"%>
|
|
||||||
<%
|
<%
|
||||||
String path = request.getContextPath();
|
String path = request.getContextPath();
|
||||||
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||||
+ path + "/";
|
|
||||||
%>
|
%>
|
||||||
<%@page import="java.sql.Connection"%>
|
<%@page import="java.sql.Connection"%>
|
||||||
<%@page import="java.sql.*"%>
|
<%@page import="java.sql.*"%>
|
||||||
@@ -38,10 +36,18 @@
|
|||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
|
||||||
|
Object user0 = session.getAttribute("actualuser");
|
||||||
String counter = null;
|
String counter = null;
|
||||||
Class.forName(driverClass);
|
Class.forName(driverClass);
|
||||||
|
try{
|
||||||
Object user0 = session.getAttribute("actualuser");
|
Connection conn = null;
|
||||||
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
|
Statement stmt = conn.createStatement();
|
||||||
|
stmt.close();
|
||||||
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
/* out.println("欢迎"+user0);//输出当前session用户 */
|
/* out.println("欢迎"+user0);//输出当前session用户 */
|
||||||
%>
|
%>
|
||||||
<%!public String getIpAddr(HttpServletRequest request) {
|
<%!public String getIpAddr(HttpServletRequest request) {
|
||||||
@@ -62,11 +68,8 @@
|
|||||||
try {
|
try {
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
|
||||||
Statement stmt = conn.createStatement();
|
|
||||||
sql = conn.prepareStatement("update counter set visitCount=visitCount+1");
|
sql = conn.prepareStatement("update counter set visitCount=visitCount+1");
|
||||||
int rtn = sql.executeUpdate();
|
int rtn = sql.executeUpdate();
|
||||||
stmt.close();
|
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@@ -75,14 +78,11 @@
|
|||||||
try {
|
try {
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
|
||||||
Statement stmt = conn.createStatement();
|
|
||||||
sql = conn.prepareStatement("insert into iplist(IP,times,userName)values(?,?,?)");
|
sql = conn.prepareStatement("insert into iplist(IP,times,userName)values(?,?,?)");
|
||||||
sql.setString(1, counter);
|
sql.setString(1, counter);
|
||||||
sql.setString(2, str_date1);
|
sql.setString(2, str_date1);
|
||||||
sql.setString(3, (String)user0);
|
sql.setString(3, (String)user0);
|
||||||
int rtn = sql.executeUpdate();
|
int rtn = sql.executeUpdate();
|
||||||
stmt.close();
|
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@@ -91,11 +91,9 @@
|
|||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
|
|
||||||
|
|
||||||
%>
|
%>
|
||||||
登录成功.
|
登录成功. <br>
|
||||||
<br>
|
<% response.setHeader("refresh","0;url=../mainframe.jsp");%>
|
||||||
<%
|
|
||||||
response.setHeader("refresh", "0;url=../mainframe.jsp");
|
|
||||||
%>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -36,6 +36,7 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn= DriverManager.getConnection(url,use,password);
|
Connection conn= DriverManager.getConnection(url,use,password);
|
||||||
PreparedStatement sql =conn.prepareStatement("insert into user(userName,password,Email,phoneNum)values(?,?,?,?)");
|
PreparedStatement sql =conn.prepareStatement("insert into user(userName,password,Email,phoneNum)values(?,?,?,?)");
|
||||||
sql.setString(1,users);
|
sql.setString(1,users);
|
||||||
@@ -45,6 +46,9 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
|
|||||||
int rtn=sql.executeUpdate();
|
int rtn=sql.executeUpdate();
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<% response.setHeader("refresh","0;url=../signin_show.jsp");%>
|
<% response.setHeader("refresh","0;url=../signin_show.jsp");%>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn = DriverManager.getConnection(url, use, password);
|
Connection conn = DriverManager.getConnection(url, use, password);
|
||||||
PreparedStatement sql = conn
|
PreparedStatement sql = conn
|
||||||
.prepareStatement("delete from user where userName=?");
|
.prepareStatement("delete from user where userName=?");
|
||||||
@@ -47,6 +48,9 @@
|
|||||||
}
|
}
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是插入成功 -->
|
<!-- 判断是否是插入成功 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
Connection conn = DriverManager.getConnection(url, use, password);
|
Connection conn = DriverManager.getConnection(url, use, password);
|
||||||
PreparedStatement sql = conn
|
PreparedStatement sql = conn
|
||||||
.prepareStatement("update user set userName=?,Email=?,Administrator = (case ? when '是' then '1'else '0' end ),VIP = (case ? when '是' then '1'else '0' end )where userName=?;");
|
.prepareStatement("update user set userName=?,Email=?,Administrator = (case ? when '是' then '1'else '0' end ),VIP = (case ? when '是' then '1'else '0' end )where userName=?;");
|
||||||
@@ -54,6 +55,9 @@
|
|||||||
}
|
}
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是插入成功 -->
|
<!-- 判断是否是插入成功 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -23,9 +23,7 @@
|
|||||||
<%
|
<%
|
||||||
request.setCharacterEncoding("utf-8");
|
request.setCharacterEncoding("utf-8");
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
PreparedStatement sql = null;
|
|
||||||
ResultSet rs = null;
|
|
||||||
Connection conn = null;
|
|
||||||
if (session.getAttribute("actualuser") == null) {
|
if (session.getAttribute("actualuser") == null) {
|
||||||
out.println(
|
out.println(
|
||||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||||
@@ -41,6 +39,10 @@
|
|||||||
String use = "root";
|
String use = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
|
try{
|
||||||
|
PreparedStatement sql = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
Connection conn = null;
|
||||||
conn = DriverManager.getConnection(url, use, password);
|
conn = DriverManager.getConnection(url, use, password);
|
||||||
sql = conn.prepareStatement("select * from show_user where userName=? and VIP=1");
|
sql = conn.prepareStatement("select * from show_user where userName=? and VIP=1");
|
||||||
sql.setString(1, users);
|
sql.setString(1, users);
|
||||||
@@ -51,6 +53,9 @@
|
|||||||
rs.close();
|
rs.close();
|
||||||
sql.close();
|
sql.close();
|
||||||
conn.close();
|
conn.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
<!-- 判断是否是管理员 -->
|
<!-- 判断是否是管理员 -->
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -62,11 +62,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from administrator_job");
|
sql = conn.prepareStatement("select * from administrator_job");
|
||||||
@@ -76,14 +77,16 @@
|
|||||||
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -41,11 +41,11 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from adminstrator_record");
|
sql = conn.prepareStatement("select * from adminstrator_record");
|
||||||
@@ -55,14 +55,16 @@
|
|||||||
<option value="<%=rs.getString("AdminName")%>"><%=rs.getString("AdminName")%></option>
|
<option value="<%=rs.getString("AdminName")%>"><%=rs.getString("AdminName")%></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -62,11 +62,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from administrator_job");
|
sql = conn.prepareStatement("select * from administrator_job");
|
||||||
@@ -76,14 +77,16 @@
|
|||||||
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -42,10 +42,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
Class.forName(driverClass);
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
@@ -56,14 +58,16 @@
|
|||||||
<option value="<%=rs.getString("AdminName")%>"><%=rs.getString("AdminName")%></option>
|
<option value="<%=rs.getString("AdminName")%>"><%=rs.getString("AdminName")%></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -42,11 +42,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from administrator_job");
|
sql = conn.prepareStatement("select * from administrator_job");
|
||||||
@@ -56,14 +57,16 @@
|
|||||||
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -42,11 +42,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from show_user");
|
sql = conn.prepareStatement("select * from show_user");
|
||||||
@@ -56,14 +57,16 @@
|
|||||||
<option value="<%=rs.getString("userName")%>"><%=rs.getString("userName")%></option>
|
<option value="<%=rs.getString("userName")%>"><%=rs.getString("userName")%></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,9 +33,7 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
ResultSet rs = null;
|
Class.forName(driverClass);
|
||||||
Connection conn = null;
|
|
||||||
PreparedStatement sql = null;
|
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +46,9 @@
|
|||||||
<div class="col-sm-12 col-lg-9 col-md-9">
|
<div class="col-sm-12 col-lg-9 col-md-9">
|
||||||
<%
|
<%
|
||||||
try {
|
try {
|
||||||
Class.forName(driverClass);
|
ResultSet rs = null;
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement sql = null;
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from adminstrator_record where AdminName=?");
|
sql = conn.prepareStatement("select * from adminstrator_record where AdminName=?");
|
||||||
@@ -83,6 +83,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -93,7 +97,9 @@
|
|||||||
<select name="job" class="form-control" name="job">
|
<select name="job" class="form-control" name="job">
|
||||||
<%
|
<%
|
||||||
try {
|
try {
|
||||||
Class.forName(driverClass);
|
ResultSet rs = null;
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement sql = null;
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from administrator_job");
|
sql = conn.prepareStatement("select * from administrator_job");
|
||||||
@@ -103,14 +109,16 @@
|
|||||||
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,9 +33,7 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
ResultSet rs = null;
|
Class.forName(driverClass);
|
||||||
Connection conn = null;
|
|
||||||
PreparedStatement sql = null;
|
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +46,10 @@
|
|||||||
<div class="col-sm-12 col-lg-9 col-md-9">
|
<div class="col-sm-12 col-lg-9 col-md-9">
|
||||||
<%
|
<%
|
||||||
try {
|
try {
|
||||||
Class.forName(driverClass);
|
ResultSet rs = null;
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement sql = null;
|
||||||
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select userName,Email, VIP,Administrator from show_user where userName=?");
|
sql = conn.prepareStatement("select userName,Email, VIP,Administrator from show_user where userName=?");
|
||||||
@@ -121,14 +122,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -114,11 +114,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from adminstrator_record");
|
sql = conn.prepareStatement("select * from adminstrator_record");
|
||||||
@@ -153,6 +154,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -162,9 +167,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
<%@ include file="module/footer.jsp"%>
|
<%@ include file="module/footer.jsp"%>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -41,11 +41,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from show_user");
|
sql = conn.prepareStatement("select * from show_user");
|
||||||
@@ -55,14 +56,16 @@
|
|||||||
<option value="<%=rs.getString("userName")%>"><%=rs.getString("userName")%></option>
|
<option value="<%=rs.getString("userName")%>"><%=rs.getString("userName")%></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -55,11 +55,11 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from adminstrator_record");
|
sql = conn.prepareStatement("select * from adminstrator_record");
|
||||||
@@ -75,14 +75,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -121,7 +123,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
try {
|
try {
|
||||||
Class.forName(driverClass);
|
ResultSet rs = null;
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement sql = null;
|
||||||
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from admin_view");
|
sql = conn.prepareStatement("select * from admin_view");
|
||||||
@@ -137,6 +142,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -158,9 +167,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
<%@ include file="module/footer.jsp"%>
|
<%@ include file="module/footer.jsp"%>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,11 +53,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from administrator_job");
|
sql = conn.prepareStatement("select * from administrator_job");
|
||||||
@@ -71,14 +72,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -54,11 +54,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement(
|
sql = conn.prepareStatement(
|
||||||
@@ -74,14 +75,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -56,11 +56,12 @@
|
|||||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||||
String user = "root";
|
String user = "root";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
Class.forName(driverClass);
|
||||||
|
try {
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement sql = null;
|
PreparedStatement sql = null;
|
||||||
try {
|
|
||||||
Class.forName(driverClass);
|
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
sql = conn.prepareStatement("select * from x2_resourse");
|
sql = conn.prepareStatement("select * from x2_resourse");
|
||||||
@@ -77,14 +78,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
|
sql.close();
|
||||||
|
rs.close();
|
||||||
|
conn.close();
|
||||||
|
stmt.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
sql.close();
|
|
||||||
rs.close();
|
|
||||||
conn.close();
|
|
||||||
%>
|
%>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user