diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/.keep" "b/\346\272\220\344\273\243\347\240\201/WebRoot/.keep"
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/META-INF/MANIFEST.MF" "b/\346\272\220\344\273\243\347\240\201/WebRoot/META-INF/MANIFEST.MF"
new file mode 100644
index 0000000000000000000000000000000000000000..5e9495128c0376427420c4189993b3851770b702
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/META-INF/MANIFEST.MF"
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/classes/c3p0-config.xml" "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/classes/c3p0-config.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..b4483f216d18285d96b92f05949e7858d764db13
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/classes/c3p0-config.xml"
@@ -0,0 +1,26 @@
+
+
+
+ com.mysql.cj.jdbc.Driver
+ jdbc:mysql://192.168.153.128:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ 123456
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
+ com.mysql.cj.jdbc.Driver
+ jdbc:mysql://192.168.153.128:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ 123456
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
+
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/classes/dbconfig.properties" "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/classes/dbconfig.properties"
new file mode 100644
index 0000000000000000000000000000000000000000..ef5da4935613f765336c96e6a6833c4b634c983f
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/classes/dbconfig.properties"
@@ -0,0 +1,5 @@
+mysql.driverClass= com.mysql.cj.jdbc.Driver
+mysql.url=jdbc:mysql://192.168.153.128:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+mysql.name=root
+mysql.pwd=123456
+
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/c3p0-0.9.1.2-jdk1.3.jar" "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/c3p0-0.9.1.2-jdk1.3.jar"
new file mode 100644
index 0000000000000000000000000000000000000000..719814ac89c1954e9e6e640091ae757f3a001fbb
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/c3p0-0.9.1.2-jdk1.3.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/c3p0-0.9.1.2.jar" "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/c3p0-0.9.1.2.jar"
new file mode 100644
index 0000000000000000000000000000000000000000..0f42d60e316c0cb25c8a24b6c2b20918b132fd1d
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/c3p0-0.9.1.2.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/c3p0-oracle-thin-extras-0.9.1.2.jar" "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/c3p0-oracle-thin-extras-0.9.1.2.jar"
new file mode 100644
index 0000000000000000000000000000000000000000..b103f66c33425d4b9fd69d5b618c003368bfd368
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/c3p0-oracle-thin-extras-0.9.1.2.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/hamcrest-core-1.3.jar" "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/hamcrest-core-1.3.jar"
new file mode 100644
index 0000000000000000000000000000000000000000..9d5fe16e3dd37ebe79a36f61f5d0e1a69a653a8a
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/hamcrest-core-1.3.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/junit-4.12.jar" "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/junit-4.12.jar"
new file mode 100644
index 0000000000000000000000000000000000000000..3a7fc266c3e32283a2b21fe12166ebdcc33a1da1
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/junit-4.12.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/mysql-connector-j-8.0.31.jar" "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/mysql-connector-j-8.0.31.jar"
new file mode 100644
index 0000000000000000000000000000000000000000..8b74bb87b291fb3c72757ef817cd3f5c308d8d21
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/lib/mysql-connector-j-8.0.31.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/web.xml" "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/web.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..d297f8cc6e31305471f8875150aceb881f65c1fc
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/WEB-INF/web.xml"
@@ -0,0 +1,66 @@
+
+
+ UserManager3
+
+ LoginController
+ com.xxr.controller.LoginController
+
+
+ UserController
+ com.xxr.controller.UserController
+
+
+ Login
+ com.xxr.view.Login
+
+
+ Main
+ com.xxr.view.Main
+
+
+ RegisterController
+ com.xxr.controller.RegisterController
+
+
+ Register
+ com.xxr.view.Register
+
+
+ Manage
+ com.xxr.view.Manage
+
+
+
+ LoginController
+ /LoginController
+
+
+ UserController
+ /UserController
+
+
+ Login
+ /Login
+
+
+ Main
+ /Main
+
+
+ RegisterController
+ /RegisterController
+
+
+ Register
+ /Register
+
+
+ Manage
+ /Manage
+
+
+
+
+ Login
+
+
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/css/comm.css" "b/\346\272\220\344\273\243\347\240\201/WebRoot/css/comm.css"
new file mode 100644
index 0000000000000000000000000000000000000000..4c137b018ee60b5d4a004c37ec9d62a788b23762
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/css/comm.css"
@@ -0,0 +1,3 @@
+h1{
+ color:green;
+}
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/css/manage.css" "b/\346\272\220\344\273\243\347\240\201/WebRoot/css/manage.css"
new file mode 100644
index 0000000000000000000000000000000000000000..18a456d8840f6fb13dae89fc306fc7930d0882a8
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/css/manage.css"
@@ -0,0 +1,5 @@
+.gray{
+ text-decroation:none;
+ color:gray;
+ font-style:italic;
+}
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/css/mian.css" "b/\346\272\220\344\273\243\347\240\201/WebRoot/css/mian.css"
new file mode 100644
index 0000000000000000000000000000000000000000..6dd4846cfeee84cc8d4c9d7a5deb82cbcd3402bb
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/css/mian.css"
@@ -0,0 +1,3 @@
+a{
+ text-decoration:none;
+}
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/imgs/conch.gif" "b/\346\272\220\344\273\243\347\240\201/WebRoot/imgs/conch.gif"
new file mode 100644
index 0000000000000000000000000000000000000000..fdbc9c31cc6fe4bed8f55122a5d04960cdcdf2df
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/WebRoot/imgs/conch.gif" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/imgs/fish.gif" "b/\346\272\220\344\273\243\347\240\201/WebRoot/imgs/fish.gif"
new file mode 100644
index 0000000000000000000000000000000000000000..b32fd9c2e656f67c86af66e64c7a1525127221d6
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/WebRoot/imgs/fish.gif" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/js/1.js" "b/\346\272\220\344\273\243\347\240\201/WebRoot/js/1.js"
new file mode 100644
index 0000000000000000000000000000000000000000..57435187d563b1141a7cf7cd6e3dab4b7f0c289b
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/js/1.js"
@@ -0,0 +1,24 @@
+function init(pageNum,lastPageNum){
+
+ var first = document.getElementById("first");
+ var prev = document.getElementById("prev");
+ var next = document.getElementById("next");
+ var end = document.getElementById("end");
+
+ if(pageNum==1){
+ first.href="javascript:void(0);"
+ prev.href="javascript:void(0);"
+
+ first.className="gray";
+ prev.className="gray";
+ }
+
+ if(pageNum==lastPageNum){
+ next.href="javascript:void(0);"
+ end.href="javascript:void(0);"
+
+ next.className="gray";
+ end.className="gray";
+ }
+
+}
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/login.html" "b/\346\272\220\344\273\243\347\240\201/WebRoot/login.html"
new file mode 100644
index 0000000000000000000000000000000000000000..c2f1b4bb03d7e9073c68065d50a1b5c7b9d00a09
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/login.html"
@@ -0,0 +1,25 @@
+
+
+
+ hello
+
+
+
+
+
+
+
+
+
+
+ 用户登录
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/main.html" "b/\346\272\220\344\273\243\347\240\201/WebRoot/main.html"
new file mode 100644
index 0000000000000000000000000000000000000000..ee0143d11a1771cb9b6c5e45c29098077c4cb15c
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/main.html"
@@ -0,0 +1,17 @@
+
+
+
+ successfully
+
+
+
+
+
+
+
+
+
+
+ 登录成功,欢迎!
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/main2.html" "b/\346\272\220\344\273\243\347\240\201/WebRoot/main2.html"
new file mode 100644
index 0000000000000000000000000000000000000000..290a1edf15d7a8da9a4dcab013792e1ea0313a3d
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/main2.html"
@@ -0,0 +1,17 @@
+
+
+
+ successfully
+
+
+
+
+
+
+
+
+
+
+ 注册成功!
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/WebRoot/register.html" "b/\346\272\220\344\273\243\347\240\201/WebRoot/register.html"
new file mode 100644
index 0000000000000000000000000000000000000000..07318176c903c7421cabb1f5581e283845d9b342
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/WebRoot/register.html"
@@ -0,0 +1,42 @@
+
+
+
+ 注册页面
+
+
+
+
+
+
+
+
+
+
+ 用户注册
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/src/.keep" "b/\346\272\220\344\273\243\347\240\201/src/.keep"
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git "a/\346\272\220\344\273\243\347\240\201/src/c3p0-config.xml" "b/\346\272\220\344\273\243\347\240\201/src/c3p0-config.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..b4483f216d18285d96b92f05949e7858d764db13
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/c3p0-config.xml"
@@ -0,0 +1,26 @@
+
+
+
+ com.mysql.cj.jdbc.Driver
+ jdbc:mysql://192.168.153.128:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ 123456
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
+ com.mysql.cj.jdbc.Driver
+ jdbc:mysql://192.168.153.128:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ 123456
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
+
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/controller/LoginController.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/controller/LoginController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..d31ec5d27bae90b9985258d51e0256f33171715b
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/controller/LoginController.java"
@@ -0,0 +1,91 @@
+package com.xxr.controller;
+
+
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xxr.entity.Users;
+import com.xxr.service.UserService;
+import com.xxr.service.impl.UserServiceImpl;
+import com.xxr.util.Base64Util;
+import com.xxr.util.DBHelper;
+import com.xxr.util.JdbcUtil;
+
+public class LoginController extends HttpServlet {
+
+ UserService userService = new UserServiceImpl();
+
+ public void doGet(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ res.setContentType("text/html;charset=utf-8");
+ PrintWriter out = res.getWriter();
+ req.setCharacterEncoding("utf-8");
+
+ String username = req.getParameter("username");
+ String pwd = req.getParameter("pwd");
+
+ // System.out.println(username);
+ // System.out.println(pwd);
+
+ // 登录验证
+
+ Users users = new Users();
+
+ users.setName(username);
+ users.setPwd(pwd);
+
+ boolean flag = userService.checkUser(users);
+
+ if (flag) {
+ // 登录成功
+ req.getRequestDispatcher("/Main").forward(req, res);
+ } else {
+ // 登录失败
+ String errMsg = "用户名不存在或密码错误,请重新输入!";
+ req.setAttribute("errMsg", errMsg);
+ req.getRequestDispatcher("/Login").forward(req, res);// 请求转发
+
+ }
+
+ out.flush();
+ out.close();
+
+ }
+
+ private boolean checkUser(String name, String pwd) {
+
+ boolean flag = false;
+
+ try {
+ // 1、加载驱动
+ // 2、获得数据库连接
+ // 3、创建表示sql的语句对象
+ // 4、执行sql,如果有结果,写入结果集
+ String sql = "select * from users where name=? and pwd=?";
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return flag;
+ }
+
+ public void doPost(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ this.doGet(req, res);
+
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/controller/RegisterController.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/controller/RegisterController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..8eb818d6d68df0a7f99554c48d129b0dfedf5c03
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/controller/RegisterController.java"
@@ -0,0 +1,74 @@
+package com.xxr.controller;
+import java.io.IOException;
+
+import java.io.PrintWriter;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xxr.entity.Users;
+import com.xxr.util.Base64Util;
+import com.xxr.util.DBHelper;
+import com.xxr.util.JdbcUtil;
+import java.util.Date;
+
+import jdk.nashorn.internal.runtime.UserAccessorProperty;
+
+public class RegisterController extends HttpServlet {
+
+
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
+
+ DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ res.setContentType("text/html;charset=utf-8");
+ req.setCharacterEncoding("utf-8");
+ String username =req.getParameter("username");
+ String pwd1=req.getParameter("pwd1");
+ String pwd2=req.getParameter("pwd2");
+ String nickname =req.getParameter("nickname");
+ String gender =req.getParameter("gender");
+ String birthday =req.getParameter("birthday");
+ Date bir = null;
+ try {
+ bir = format.parse(birthday);
+ } catch (ParseException e) {
+ e.printStackTrace();
+ }
+ String hobby =req.getParameter("hobby");
+ String tel=req.getParameter("tel");
+ String email =req.getParameter("email");
+ int grade =Integer.parseInt(req.getParameter("grade"));
+ String description =req.getParameter("description");
+ if(pwd1.equals(pwd2))
+ {
+ RegisterIn(username,nickname,pwd1,gender,bir,hobby,tel,email,grade,description);
+ String errMsg = "注册成功!请登录!";
+ req.setAttribute("errMsg", errMsg);
+ req.getRequestDispatcher("/Login").forward(req, res);// 请求转发
+ }
+
+ }
+
+
+ private void RegisterIn(String username,String nickname,String pwd1, String gender, Date bir, String hobby,
+ String tel, String email, int grade, String description) {
+ int row=0;
+ String sql="insert into users(name,nickName,pwd,gender,birthday,hobby,tel,email,grade,description)values(?,?,?,?,?,?,?,?,?,?)" ;
+ Object[] params={username,nickname,Base64Util.encode(pwd1),gender,bir,hobby,
+ tel,email,grade,description};
+ row=DBHelper.executeUpdate(sql, params);
+
+ }
+
+
+ public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
+
+ this.doGet(req, res);
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/controller/UserController.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/controller/UserController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..4dc185af084d764f4f0af3a251a62f3344d4c87e
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/controller/UserController.java"
@@ -0,0 +1,68 @@
+package com.xxr.controller;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.util.ArrayList;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xxr.entity.Users;
+import com.xxr.service.UserService;
+import com.xxr.service.impl.UserServiceImpl;
+import com.xxr.util.Base64Util;
+import com.xxr.util.DBHelper;
+import com.xxr.util.JdbcUtil;
+
+public class UserController extends HttpServlet {
+
+ UserService userService = new UserServiceImpl();
+
+ public void doGet(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ res.setContentType("text/html;charset=utf-8");
+ PrintWriter out = res.getWriter();
+ req.setCharacterEncoding("utf-8");
+
+ int pageNum = 1, pageSize = 3;
+
+ String num = req.getParameter("pageNum");
+ String size = req.getParameter("pageSize");
+
+ if (num != null) {
+ pageNum = Integer.parseInt(num);
+ }
+ if (size != null) {
+ pageSize = Integer.parseInt(size);
+ }
+
+ ArrayList list = userService.getPageUsers(pageNum, pageSize);
+ int pageCount = userService.getPageCount();
+
+ req.setAttribute("list", list);
+ req.setAttribute("pageNum", pageNum);
+ req.setAttribute("pageSize", pageSize);
+ req.setAttribute("pageCount", pageCount);
+ req.getRequestDispatcher("/Manage").forward(req, res);// 请求转发
+
+ out.flush();
+ out.close();
+
+ }
+
+ public void doPost(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ this.doGet(req, res);
+
+ }
+
+}
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/dao/UserDao.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/dao/UserDao.java"
new file mode 100644
index 0000000000000000000000000000000000000000..2676aa2528bce94375b56b562880e3c6f0887df7
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/dao/UserDao.java"
@@ -0,0 +1,62 @@
+package com.xxr.dao;
+
+
+import java.util.ArrayList;
+
+import com.xxr.entity.Users;
+import com.xxr.exeception.IdIsNullException;
+
+public interface UserDao {
+
+ /**
+ * 添加单个用户
+ * @param users
+ * @return
+ */
+ public int addUser(Users users);
+
+ /**
+ * 根据id删除单个用户
+ * @param id
+ * @return
+ * @throws IdIsNullException
+ */
+ public int delUserById(Integer id) throws IdIsNullException;
+
+ /**
+ * 根据id修改单个用户
+ * @param users
+ * @param id
+ * @return
+ * @throws IdIsNullException
+ */
+ public int updateUserById(Users users, Integer id) throws IdIsNullException;
+
+ /**
+ * 查询所有用户
+ * @return
+ */
+ public ArrayList getAllUsers();
+
+ /**
+ * 查询分页用户
+ * @param pageNum
+ * @param pageSize
+ * @return
+ */
+ public ArrayList getPageUsers(int pageNum, int pageSize);
+
+ /**
+ * 查询总记录数
+ * @return
+ */
+ public int getPageCount();
+
+ /**
+ * 根据用户名和密码查询单个用户
+ * @param users
+ * @return
+ */
+ public boolean checkUser(Users users);
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/entity/Users.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/entity/Users.java"
new file mode 100644
index 0000000000000000000000000000000000000000..ea82e5dd8376da426dc3bebb3586b1b0f61592ed
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/entity/Users.java"
@@ -0,0 +1,99 @@
+package com.xxr.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Users implements Serializable{
+ //①所有子段私有
+ private Integer id;
+ private String name;
+ private String nickName;
+ private String pwd;
+ private String gender;
+ private Date birthday;
+ private String hobby;
+ private String tel;
+ private String email;
+ private int grade;
+ private String description;
+
+ //②共有getter和setter方法
+ public Integer getId() {
+ return id;
+ }
+ public void setId(Integer id) {
+ this.id = id;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getNickName() {
+ return nickName;
+ }
+ public void setNickName(String nickName) {
+ this.nickName = nickName;
+ }
+ public String getPwd() {
+ return pwd;
+ }
+ public void setPwd(String pwd) {
+ this.pwd = pwd;
+ }
+ public String getGender() {
+ return gender;
+ }
+ public void setGender(String gender) {
+ this.gender = gender;
+ }
+ public Date getBirthday() {
+ return birthday;
+ }
+ public void setBirthday(Date birthday) {
+ this.birthday = birthday;
+ }
+ public String getHobby() {
+ return hobby;
+ }
+ public void setHobby(String hobby) {
+ this.hobby = hobby;
+ }
+ public String getTel() {
+ return tel;
+ }
+ public void setTel(String tel) {
+ this.tel = tel;
+ }
+ public String getEmail() {
+ return email;
+ }
+ public void setEmail(String email) {
+ this.email = email;
+ }
+ public int getGrade() {
+ return grade;
+ }
+ public void setGrade(int grade) {
+ this.grade = grade;
+ }
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ @Override
+ public String toString() {
+ return "Users [id=" + id + ", name=" + name + ", nickName=" + nickName
+ + ", pwd=" + pwd + ", gender=" + gender + ", birthday="
+ + birthday + ", hobby=" + hobby + ", tel=" + tel + ", email="
+ + email + ", grade=" + grade + ", description=" + description
+ + "]";
+ }
+
+ //③无参构造方法
+
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/exeception/IdIsNullException.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/exeception/IdIsNullException.java"
new file mode 100644
index 0000000000000000000000000000000000000000..3a89371933987e9765c13764be55e614144ebf64
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/exeception/IdIsNullException.java"
@@ -0,0 +1,30 @@
+package com.xxr.exeception;
+
+public class IdIsNullException extends Exception {
+
+ public IdIsNullException() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public IdIsNullException(String message) {
+ super(message);
+ // TODO Auto-generated constructor stub
+ }
+
+ public IdIsNullException(Throwable cause) {
+ super(cause);
+ // TODO Auto-generated constructor stub
+ }
+
+ public IdIsNullException(String message, Throwable cause) {
+ super(message, cause);
+ // TODO Auto-generated constructor stub
+ }
+
+ public IdIsNullException(String message, Throwable cause,
+ boolean enableSuppression, boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ // TODO Auto-generated constructor stub
+ }
+
+}
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/jdbc/jdbcDemo.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/jdbc/jdbcDemo.java"
new file mode 100644
index 0000000000000000000000000000000000000000..14344c8291ebf03f83fbb4ca27a5414adacd1e1b
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/jdbc/jdbcDemo.java"
@@ -0,0 +1,44 @@
+package com.xxr.jdbc;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.Statement;
+
+public class jdbcDemo {
+ public static void main(String[] args){
+
+ try {
+ //1.加载驱动
+ Class.forName("com.mysql.jdbc.Driver");
+
+ //2.获得数据库连接
+ Connection conn =DriverManager.getConnection("jdbc:mysql://192.168.153.128:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false", "root", "123456");
+ //3.创建表示sql 的语句对象
+ Statement stmt=conn.createStatement();
+ //4.执行sql,如果有结果,写入结果集
+ String sql="insert into users(name,nickName,pwd,gender,birthday,hobby,tel,email,grade,description)+ values('李四','老三','123','1','2023-01-01','吃饭睡觉写程序','139000000001','001@qq.com','11,'无')";
+ int res = stmt.executeUpdate(sql);
+ //5.遍历结果集
+ System.out.println("影响了"+res+"行");
+
+ //6.关闭资源
+ if(stmt!=null){
+ stmt.close();
+ stmt=null; //垃圾回收,上!
+
+ }
+ if(conn!=null){
+ conn.close();
+ conn=null;
+
+ }
+
+
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/service/UserService.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/service/UserService.java"
new file mode 100644
index 0000000000000000000000000000000000000000..ac57320ab3e41aa52f8cdbf9571a6270b43841cf
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/service/UserService.java"
@@ -0,0 +1,60 @@
+package com.xxr.service;
+
+import java.util.ArrayList;
+
+import com.xxr.entity.Users;
+import com.xxr.exeception.IdIsNullException;
+
+public interface UserService {
+ /**
+ * 添加单个用户
+ * @param users
+ * @return
+ */
+ public int addUser(Users users);
+
+ /**
+ * 根据id删除单个用户
+ * @param id
+ * @return
+ * @throws IdIsNullException
+ */
+ public int delUserById(Integer id) throws IdIsNullException;
+
+ /**
+ * 根据id修改单个用户
+ * @param users
+ * @param id
+ * @return
+ * @throws IdIsNullException
+ */
+ public int updateUserById(Users users,Integer id) throws IdIsNullException;
+
+ /**
+ * 查询所有用户
+ * @return
+ */
+ public ArrayList getAllUsers();
+
+ /**
+ * 查询分页用户
+ * @param pageNum
+ * @param pageSize
+ * @return
+ */
+ public ArrayList getPageUsers(int pageNum, int pageSize);
+
+ /**
+ * 查询总记录数
+ * @return
+ */
+ public int getPageCount();
+
+ /**
+ * 根据用户名和密码查询单个用户
+ * @param users
+ * @return
+ */
+ public boolean checkUser(Users users);
+}
+
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/test/UserDaoImplTest.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/test/UserDaoImplTest.java"
new file mode 100644
index 0000000000000000000000000000000000000000..ef10bccb410fda6cf9261e743210522771f20f00
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/test/UserDaoImplTest.java"
@@ -0,0 +1,49 @@
+package com.xxr.test;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import com.xxr.dao.UserDao;
+import com.xxr.dao.impl.UserDaoImpl;
+import com.xxr.entity.Users;
+
+public class UserDaoImplTest {
+
+ UserDao userdao = new UserDaoImpl();
+
+ @Test
+ public void testAddUser() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testDelUserById() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testUpdateUserById() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testGetAllUsers() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testCheckUser() {
+
+ Users users = new Users();
+
+ users.setName("宋江");
+ users.setPwd("123");
+
+ boolean flag = userdao.checkUser(users);
+ System.out.println("res=" + flag);
+ // 断言
+ assertEquals(flag, true);
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/test/UserDaoImplTest2.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/test/UserDaoImplTest2.java"
new file mode 100644
index 0000000000000000000000000000000000000000..379f3b18c6da5bf81fd27ca71667af6a28222cc2
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/test/UserDaoImplTest2.java"
@@ -0,0 +1,74 @@
+package com.xxr.test;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+
+import org.junit.Test;
+
+import com.xxr.dao.UserDao;
+import com.xxr.dao.impl.UserDaoImpl;
+import com.xxr.dao.impl.UserDaoImpl2;
+import com.xxr.entity.Users;
+
+public class UserDaoImplTest2 {
+
+ UserDao userdao = new UserDaoImpl2();
+
+ @Test
+ public void testAddUser() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testDelUserById() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testUpdateUserById() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testGetAllUsers() {
+
+ ArrayList list = userdao.getAllUsers();
+ System.out.println(list);
+ // 断言
+ assertNotEquals(list, null);
+ }
+
+ @Test
+ public void testGetPageUsers() {
+
+ ArrayList list = userdao.getPageUsers(3,2);
+ System.out.println(list);
+ // 断言
+ assertNotEquals(list, null);
+ }
+
+ @Test
+ public void testCheckUser() {
+
+ Users users = new Users();
+
+ users.setName("李逵");
+ users.setPwd("123");
+
+ boolean flag = userdao.checkUser(users);
+ System.out.println("res=" + flag);
+ // 断言
+ assertEquals(flag, true);
+ }
+
+ @Test
+ public void testGetPageCount() {
+
+ int res = userdao.getPageCount();
+ System.out.println("res=" + res);
+ // 断言
+ assertNotEquals(res, 0);
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/test/UserServiceImplTest.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/test/UserServiceImplTest.java"
new file mode 100644
index 0000000000000000000000000000000000000000..98d6873286b4a9e942ae2090d7401efd789db08d
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/test/UserServiceImplTest.java"
@@ -0,0 +1,71 @@
+package com.xxr.test;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+
+import org.junit.Test;
+
+import com.xxr.entity.Users;
+import com.xxr.service.UserService;
+import com.xxr.service.impl.UserServiceImpl;
+
+public class UserServiceImplTest {
+
+ UserService userService=new UserServiceImpl();
+
+ @Test
+ public void testAddUser() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testDelUserById() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testUpdateUserById() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testGetAllUsers() {
+ ArrayList list = userService.getAllUsers();
+ System.out.println(list);
+ // 断言
+ assertNotEquals(list, null);
+ }
+
+ @Test
+ public void testGetPageUsers() {
+ ArrayList list = userService.getPageUsers(3,2);
+ System.out.println(list);
+ // 断言
+ assertNotEquals(list, null);
+ }
+
+ @Test
+ public void testCheckUser() {
+ Users users = new Users();
+
+ users.setName("李逵");
+ users.setPwd("123");
+
+ boolean flag = userService.checkUser(users);
+ System.out.println("res=" + flag);
+ // 断言
+ assertEquals(flag, true);
+ }
+
+ @Test
+ public void testGetPageCount() {
+
+ int res = userService.getPageCount();
+ System.out.println("res=" + res);
+ // 断言
+ assertNotEquals(res, 0);
+ }
+
+}
+
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/Base64Util.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/Base64Util.java"
new file mode 100644
index 0000000000000000000000000000000000000000..14333e1890ea0e185ab636074724b31005168d3e
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/Base64Util.java"
@@ -0,0 +1,39 @@
+package com.xxr.util;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+import sun.misc.*;
+
+public class Base64Util {
+
+ public static String encode(String msg) {
+
+ byte[] b = null;
+ BASE64Encoder encoder = null;
+
+ try {
+ MessageDigest md = MessageDigest.getInstance("md5");
+ b = md.digest(msg.getBytes());
+
+ encoder = new BASE64Encoder();
+
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ }
+
+ return encoder.encode(b);
+ }
+
+ public static void main(String[] args) {
+
+ String x = "123";
+ String y = "456";
+ String z = "789";
+
+ System.out.println(encode(x));
+ System.out.println(encode(y));
+ System.out.println(encode(z));
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/C3P0Util.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/C3P0Util.java"
new file mode 100644
index 0000000000000000000000000000000000000000..795504fbc25fab3377c705355031e96d02ef0613
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/C3P0Util.java"
@@ -0,0 +1,62 @@
+package com.xxr.util;
+
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+
+import com.mchange.v2.c3p0.ComboPooledDataSource;
+
+
+public class C3P0Util {
+
+ private static ComboPooledDataSource cpds = new ComboPooledDataSource("mysql");
+
+ public static Connection getConnection() {
+
+ Connection conn = null;
+
+ try {
+ conn = cpds.getConnection();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+
+ return conn;
+ }
+
+ public static void release(Connection conn, Statement ps, ResultSet rs) {
+ if (rs != null) {
+ try {
+ rs.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ rs = null; // 垃圾回收,上!
+ }
+ if (ps != null) {
+ try {
+ ps.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ ps = null; // 垃圾回收,上!
+ }
+ if (conn != null) {
+ try {
+ conn.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ conn = null;
+ }
+ }
+
+ public static void main(String[] args) {
+ System.out.println(getConnection());
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/DBHelper.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/DBHelper.java"
new file mode 100644
index 0000000000000000000000000000000000000000..3c6727709e00fc7a9223f2f64aacec09e713b8aa
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/DBHelper.java"
@@ -0,0 +1,68 @@
+package com.xxr.util;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+public class DBHelper {
+ private static Connection conn = null;
+ private static PreparedStatement ps = null;
+ private static ResultSet rs = null;
+
+ public static int executeUpdate(String sql, Object[] params) {
+
+ int res = -1;
+
+ try {
+ conn = C3P0Util.getConnection();
+ ps = conn.prepareStatement(sql);
+ // 给?赋值
+ if (params != null && params.length > 0) {
+ for (int i = 0; i < params.length; i++) {
+ ps.setObject(i + 1, params[i]);
+ }
+ }
+ res = ps.executeUpdate();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ C3P0Util.release(conn, ps, null);
+ }
+
+ return res;
+ }
+
+ public static ResultSet executeQuery(String sql, Object[] params) {
+
+ try {
+ conn = C3P0Util.getConnection();
+ ps = conn.prepareStatement(sql);
+ // 给?赋值
+ if (params != null && params.length > 0) {
+ for (int i = 0; i < params.length; i++) {
+ ps.setObject(i + 1, params[i]);
+ }
+ }
+ rs = ps.executeQuery();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ // C3P0Util.release(conn, ps, null); 延迟关闭
+ }
+
+ return rs;
+ }
+
+ public static Connection getConn() {
+ return conn;
+ }
+
+ public static PreparedStatement getPs() {
+ return ps;
+ }
+
+}
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/JdbcUtil.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/JdbcUtil.java"
new file mode 100644
index 0000000000000000000000000000000000000000..4854a75a85f5a36aae76599b18c9267a0bac2a8e
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/util/JdbcUtil.java"
@@ -0,0 +1,90 @@
+package com.xxr.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import java.sql.Statement;
+
+public class JdbcUtil {
+
+ private static String driverClass;
+ private static String url;
+ private static String name;
+ private static String pwd;
+
+ static {
+
+ try {
+ InputStream in = JdbcUtil.class.getClassLoader()
+ .getResourceAsStream("dbconfig.properties");
+ Properties props = new Properties();
+
+ props.load(in);
+
+ driverClass = props.getProperty("mysql.driverClass");
+ url = props.getProperty("mysql.url");
+ name = props.getProperty("mysql.name");
+ pwd = props.getProperty("mysql.pwd");
+
+ Class.forName(driverClass);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public static Connection getConnection() {
+
+ Connection conn = null;
+
+ try {
+ conn = DriverManager.getConnection(url, name, pwd);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+
+ return conn;
+ }
+
+ public static void release(Connection conn, Statement ps, ResultSet rs) {
+ if (rs != null) {
+ try {
+ rs.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ rs = null; // 垃圾回收,上!
+ }
+ if (ps != null) {
+ try {
+ ps.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ ps = null; // 垃圾回收,上!
+ }
+ if (conn != null) {
+ try {
+ conn.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ conn = null;
+ }
+ }
+
+ public static void main(String[] args) {
+ System.out.println(driverClass);
+ System.out.println(url);
+ System.out.println(name);
+ System.out.println(pwd);
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/view/Login.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/view/Login.java"
new file mode 100644
index 0000000000000000000000000000000000000000..a1b65f39eef935ba20331d8c0ea7c6f19761c82b
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/view/Login.java"
@@ -0,0 +1,52 @@
+package com.xxr.view;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class Login extends HttpServlet {
+
+ public void doGet(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ res.setContentType("text/html;charset=utf-8");
+ PrintWriter out = res.getWriter();
+
+ String errMsg = (String) req.getAttribute("errMsg");
+
+ out.println("hello");
+ out.println("");
+ out.println("");
+ out.println("
");
+ out.println("用户登录
");
+ out.println("");
+ out.println("
");
+ out.println("");
+
+ out.flush();
+ out.close();
+
+ }
+
+ public void doPost(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ this.doGet(req, res);
+
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/view/Main.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/view/Main.java"
new file mode 100644
index 0000000000000000000000000000000000000000..f00e4d46a5161e8701a003e693dfc81a1ae7d29c
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/view/Main.java"
@@ -0,0 +1,45 @@
+package com.xxr.view;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class Main extends HttpServlet {
+
+ public void doGet(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ res.setContentType("text/html;charset=utf-8");
+ PrintWriter out = res.getWriter();
+
+ out.println("hello");
+ out.println("");
+ out.println("");
+ out.println("");
+ out.println("
");
+ out.println("用户管理
");
+ out.println("管理用户
");
+ out.println("添加用户
");
+ out.println("查询用户
");
+ out.println("退出系统
");
+ out.println("
");
+ out.println("");
+
+ out.flush();
+ out.close();
+
+ }
+
+ public void doPost(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ this.doGet(req, res);
+
+ }
+
+}
+
diff --git "a/\346\272\220\344\273\243\347\240\201/src/com/xxr/view/Manage.java" "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/view/Manage.java"
new file mode 100644
index 0000000000000000000000000000000000000000..25b38b5b3565526de26481998beea7e30eda1d08
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/com/xxr/view/Manage.java"
@@ -0,0 +1,110 @@
+package com.xxr.view;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xxr.entity.Users;
+
+public class Manage extends HttpServlet {
+
+ public void doGet(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ res.setContentType("text/html;charset=utf-8");
+ PrintWriter out = res.getWriter();
+
+ ArrayList list = (ArrayList) req.getAttribute("list");
+ int pageNum = (Integer) req.getAttribute("pageNum");
+ int pageSize = (Integer) req.getAttribute("pageSize");
+ int pageCount = (Integer) req.getAttribute("pageCount");
+ int lastPageNum = (pageCount % pageSize != 0) ? pageCount / pageSize
+ + 1 : pageCount / pageSize;
+
+ out.println("hello");
+ out.println("");
+ out.println("");
+ out.println("");
+ out.println("");
+ out.println("
");
+ out.println("管理用户
");
+
+ out.println("");
+ out.println("" + "用户名 | " + "昵称 | " + "性别 | "
+ + "生日 | " + "爱好 | " + "电话 | " + "邮箱 | "
+ + "等级 | " + "描述 | " + "操作 | " + "
");
+
+ if (list != null && list.size() > 0) {
+ if (pageNum == lastPageNum)
+ pageSize = 2;//?
+ for (int i = 0; i < pageSize; i++) {
+ Users users = list.get(i);
+ out.println("" + ""
+ + users.getName()
+ + " | "
+ + ""
+ + users.getNickName()
+ + " | "
+ + ""
+ + ("1".equals(users.getGender()) ? "男" : "女")
+ + " | "
+ + ""
+ + users.getBirthday()
+ + " | "
+ + ""
+ + users.getHobby()
+ + " | "
+ + ""
+ + users.getTel()
+ + " | "
+ + ""
+ + users.getEmail()
+ + " | "
+ + ""
+ + users.getGrade()
+ + " | "
+ + ""
+ + users.getDescription()
+ + " | "
+ + "删除 修改 | "
+ + "
");
+ }
+ }
+
+ out.println("
");
+
+ out.println("首页");
+ out.println("上一页");
+ for (int i = 1; i < 8; i++) {
+ out.println("[" + i + "]");
+ }
+ out.println("下一页");
+ out.println("尾页");
+
+ out.println("
");
+ out.println("");
+
+ out.flush();
+ out.close();
+
+ }
+
+ public void doPost(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+
+ this.doGet(req, res);
+
+ }
+
+}
+
diff --git "a/\346\272\220\344\273\243\347\240\201/src/dbconfig.properties" "b/\346\272\220\344\273\243\347\240\201/src/dbconfig.properties"
new file mode 100644
index 0000000000000000000000000000000000000000..ef5da4935613f765336c96e6a6833c4b634c983f
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/src/dbconfig.properties"
@@ -0,0 +1,5 @@
+mysql.driverClass= com.mysql.cj.jdbc.Driver
+mysql.url=jdbc:mysql://192.168.153.128:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+mysql.name=root
+mysql.pwd=123456
+