修复所有数据库性能问题
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
PreparedStatement sql = conn
|
||||
.prepareStatement("delete from adminstrator_record where AdminName=?");
|
||||
@@ -47,6 +48,9 @@
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
}catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
PreparedStatement sql = conn
|
||||
.prepareStatement("insert into adminstrator_record(AdminNo,AdminName,Adminsex,Adminjob)values(?,?,?,?)");
|
||||
@@ -52,6 +53,9 @@
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
}catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
PreparedStatement sql = conn
|
||||
.prepareStatement("update adminstrator_record set AdminNo=?,AdminSex=?,AdminJob=? where AdminName=?");
|
||||
@@ -52,6 +53,9 @@
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
}catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
PreparedStatement sql = conn
|
||||
.prepareStatement("delete from administrator_job where AdminJob=?");
|
||||
@@ -47,6 +48,9 @@
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
PreparedStatement sql = conn
|
||||
.prepareStatement("insert into administrator_job(AdminJob,AdminDuty)values(?,?)");
|
||||
@@ -48,6 +49,9 @@
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
|
||||
@@ -33,7 +33,8 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
|
||||
String url="jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn= DriverManager.getConnection(url,use,password);
|
||||
PreparedStatement sql =conn.prepareStatement("update user set password=? where userName=?");
|
||||
sql.setString(1,pass);
|
||||
@@ -41,6 +42,9 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
|
||||
int rtn=sql.executeUpdate();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
out.println("<script language=javascript>alert('修改成功!');window.location.href='index.html'</script>");
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
PreparedStatement sql = conn
|
||||
.prepareStatement("delete from administrator_job where AdminJob=?");
|
||||
@@ -47,6 +48,9 @@
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
|
||||
if (session.getAttribute("actualuser") == null) {
|
||||
out.println(
|
||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||
@@ -41,6 +39,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 show_user where userName=? and Administrator=1");
|
||||
sql.setString(1, users);
|
||||
@@ -51,6 +53,9 @@
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是管理员 -->
|
||||
<%
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
|
||||
if (session.getAttribute("actualuser") == null) {
|
||||
out.println(
|
||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||
@@ -41,6 +39,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 show_user where userName=? and Administrator=1");
|
||||
sql.setString(1, users);
|
||||
@@ -51,6 +53,10 @@
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
%>
|
||||
<!-- 判断是否是管理员 -->
|
||||
<%
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
|
||||
if (session.getAttribute("actualuser") == null) {
|
||||
out.println(
|
||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||
@@ -41,6 +39,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 show_user where userName=? and Administrator=1");
|
||||
sql.setString(1, users);
|
||||
@@ -51,6 +53,9 @@
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是管理员 -->
|
||||
<%
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
PreparedStatement vipsql = null;
|
||||
ResultSet viprs = null;
|
||||
Connection conn = null;
|
||||
conn = DriverManager.getConnection(url, use, password);
|
||||
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=?");
|
||||
vipsql.setString(1, users);
|
||||
|
||||
@@ -1,47 +1,53 @@
|
||||
<%@ page language="java" import="java.util.*"
|
||||
contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
||||
+ path + "/";
|
||||
%>
|
||||
<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<%@page import="java.sql.Connection"%>
|
||||
<%@page import="java.sql.*"%>
|
||||
<%@page import="java.sql.DriverManager"%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<title>登录成功</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<title>登录成功</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%
|
||||
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
java.util.Date currentTime = new java.util.Date();//得到当前系统时间
|
||||
|
||||
String str_date1 = formatter.format(currentTime); //将日期时间格式化
|
||||
String str_date2 = currentTime.toString(); //将Date型日期时间转换成字符串形式
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%
|
||||
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
java.util.Date currentTime = new java.util.Date();//得到当前系统时间
|
||||
|
||||
String str_date1 = formatter.format(currentTime); //将日期时间格式化
|
||||
String str_date2 = currentTime.toString(); //将Date型日期时间转换成字符串形式
|
||||
String driverClass = "com.mysql.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
|
||||
Object user0 = session.getAttribute("actualuser");
|
||||
String counter = null;
|
||||
Class.forName(driverClass);
|
||||
|
||||
Object user0 = session.getAttribute("actualuser");
|
||||
try{
|
||||
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用户 */
|
||||
%>
|
||||
<%!public String getIpAddr(HttpServletRequest request) {
|
||||
@@ -57,45 +63,37 @@
|
||||
}
|
||||
return ip;
|
||||
}%>
|
||||
<%
|
||||
counter = getIpAddr(request);
|
||||
try {
|
||||
<%
|
||||
counter = getIpAddr(request);
|
||||
try {
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
sql = conn.prepareStatement("update counter set visitCount=visitCount+1");
|
||||
int rtn = sql.executeUpdate();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
try {
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("update counter set visitCount=visitCount+1");
|
||||
int rtn = sql.executeUpdate();
|
||||
stmt.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
try {
|
||||
Connection conn = 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.setString(1, counter);
|
||||
sql.setString(2, str_date1);
|
||||
sql.setString(3, (String) user0);
|
||||
int rtn = sql.executeUpdate();
|
||||
stmt.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql = conn.prepareStatement("insert into iplist(IP,times,userName)values(?,?,?)");
|
||||
sql.setString(1, counter);
|
||||
sql.setString(2, str_date1);
|
||||
sql.setString(3, (String)user0);
|
||||
int rtn = sql.executeUpdate();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
|
||||
|
||||
%>
|
||||
登录成功.
|
||||
<br>
|
||||
<%
|
||||
response.setHeader("refresh", "0;url=../mainframe.jsp");
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
登录成功. <br>
|
||||
<% response.setHeader("refresh","0;url=../mainframe.jsp");%>
|
||||
</body>
|
||||
</html>
|
||||
@@ -35,7 +35,8 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
|
||||
String url="jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn= DriverManager.getConnection(url,use,password);
|
||||
PreparedStatement sql =conn.prepareStatement("insert into user(userName,password,Email,phoneNum)values(?,?,?,?)");
|
||||
sql.setString(1,users);
|
||||
@@ -45,6 +46,9 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
|
||||
int rtn=sql.executeUpdate();
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<% response.setHeader("refresh","0;url=../signin_show.jsp");%>
|
||||
</body>
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
PreparedStatement sql = conn
|
||||
.prepareStatement("delete from user where userName=?");
|
||||
@@ -47,6 +48,9 @@
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
try{
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
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=?;");
|
||||
@@ -54,6 +55,9 @@
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
|
||||
if (session.getAttribute("actualuser") == null) {
|
||||
out.println(
|
||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||
@@ -41,6 +39,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 show_user where userName=? and VIP=1");
|
||||
sql.setString(1, users);
|
||||
@@ -51,6 +53,9 @@
|
||||
rs.close();
|
||||
sql.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 user = "root";
|
||||
String password = "";
|
||||
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from administrator_job");
|
||||
@@ -76,14 +77,16 @@
|
||||
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from adminstrator_record");
|
||||
@@ -55,14 +55,16 @@
|
||||
<option value="<%=rs.getString("AdminName")%>"><%=rs.getString("AdminName")%></option>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -62,11 +62,12 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from administrator_job");
|
||||
@@ -76,14 +77,16 @@
|
||||
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -42,10 +42,12 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
@@ -56,14 +58,16 @@
|
||||
<option value="<%=rs.getString("AdminName")%>"><%=rs.getString("AdminName")%></option>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -42,11 +42,12 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from administrator_job");
|
||||
@@ -56,14 +57,16 @@
|
||||
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -42,11 +42,12 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from show_user");
|
||||
@@ -56,14 +57,16 @@
|
||||
<option value="<%=rs.getString("userName")%>"><%=rs.getString("userName")%></option>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -33,9 +33,7 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
Class.forName(driverClass);
|
||||
%>
|
||||
|
||||
|
||||
@@ -48,7 +46,9 @@
|
||||
<div class="col-sm-12 col-lg-9 col-md-9">
|
||||
<%
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from adminstrator_record where AdminName=?");
|
||||
@@ -83,6 +83,10 @@
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
@@ -93,7 +97,9 @@
|
||||
<select name="job" class="form-control" name="job">
|
||||
<%
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from administrator_job");
|
||||
@@ -103,14 +109,16 @@
|
||||
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></option>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -33,9 +33,7 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
Class.forName(driverClass);
|
||||
%>
|
||||
|
||||
|
||||
@@ -48,7 +46,10 @@
|
||||
<div class="col-sm-12 col-lg-9 col-md-9">
|
||||
<%
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select userName,Email, VIP,Administrator from show_user where userName=?");
|
||||
@@ -121,14 +122,16 @@
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -114,11 +114,12 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from adminstrator_record");
|
||||
@@ -153,6 +154,10 @@
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
@@ -162,9 +167,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
<%@ include file="module/footer.jsp"%>
|
||||
</div>
|
||||
|
||||
@@ -41,11 +41,12 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from show_user");
|
||||
@@ -55,14 +56,16 @@
|
||||
<option value="<%=rs.getString("userName")%>"><%=rs.getString("userName")%></option>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -55,11 +55,11 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from adminstrator_record");
|
||||
@@ -75,14 +75,16 @@
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</table>
|
||||
</div>
|
||||
@@ -121,7 +123,10 @@
|
||||
</tr>
|
||||
<%
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from admin_view");
|
||||
@@ -137,6 +142,10 @@
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
@@ -158,9 +167,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
<%@ include file="module/footer.jsp"%>
|
||||
</div>
|
||||
|
||||
@@ -53,11 +53,12 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from administrator_job");
|
||||
@@ -71,14 +72,16 @@
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -54,11 +54,12 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement(
|
||||
@@ -74,14 +75,16 @@
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -56,11 +56,12 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
Class.forName(driverClass);
|
||||
try {
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from x2_resourse");
|
||||
@@ -77,14 +78,16 @@
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user