diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/.classpath" "b/\346\272\220\344\273\243\347\240\201/UserManage3/.classpath"
new file mode 100644
index 0000000000000000000000000000000000000000..734a1dbfd07a58741182909e8367ad28f4160328
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/.classpath"
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/.project" "b/\346\272\220\344\273\243\347\240\201/UserManage3/.project"
new file mode 100644
index 0000000000000000000000000000000000000000..b1a9d479095cebc198eb615b65adfa245d63bee0
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/.project"
@@ -0,0 +1,46 @@
+
+
+ UserManage3
+
+
+
+
+
+ org.eclipse.wst.jsdt.core.javascriptValidator
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.wst.common.project.facet.core.builder
+
+
+
+
+ org.eclipse.wst.validation.validationbuilder
+
+
+
+
+ com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator
+
+
+
+
+ com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder
+
+
+
+
+
+ org.eclipse.jem.workbench.JavaEMFNature
+ org.eclipse.wst.common.modulecore.ModuleCoreNature
+ org.eclipse.wst.common.project.facet.core.nature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.wst.jsdt.core.jsNature
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/.jsdtscope" "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/.jsdtscope"
new file mode 100644
index 0000000000000000000000000000000000000000..2fc9dba18dabdf63d18374991e2ea27ebd54f062
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/.jsdtscope"
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/com.genuitec.runtime.libraries.xml" "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/com.genuitec.runtime.libraries.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..d3fbf3f83945e94e30aa5d43c2c440e7a34eeb0d
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/com.genuitec.runtime.libraries.xml"
@@ -0,0 +1,4 @@
+
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.jdt.core.prefs" "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.jdt.core.prefs"
new file mode 100644
index 0000000000000000000000000000000000000000..c537b63063ce6052bdc49c5fd0745b078f162c90
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.jdt.core.prefs"
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.common.component" "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.common.component"
new file mode 100644
index 0000000000000000000000000000000000000000..cb46aa820e2db7f4d152b227fee793e6e8d0731c
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.common.component"
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.common.project.facet.core.xml" "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.common.project.facet.core.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..c6c4b97ba8586bf06e6ac6bfb12c38f1fed43988
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.common.project.facet.core.xml"
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.jsdt.ui.superType.container" "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.jsdt.ui.superType.container"
new file mode 100644
index 0000000000000000000000000000000000000000..3bd5d0a4803967bc0bf72a7dd66d7e292ed2e586
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.jsdt.ui.superType.container"
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.jsdt.ui.superType.name" "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.jsdt.ui.superType.name"
new file mode 100644
index 0000000000000000000000000000000000000000..05bd71b6ec2c1982d1e8a5653073281994564ae8
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/.settings/org.eclipse.wst.jsdt.ui.superType.name"
@@ -0,0 +1 @@
+Window
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/META-INF/MANIFEST.MF" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/META-INF/MANIFEST.MF"
new file mode 100644
index 0000000000000000000000000000000000000000..254272e1c0740423e25eb40be9a98ce1556474b1
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/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/UserManage3/WebRoot/WEB-INF/classes/c3p0-config.xml" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/c3p0-config.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..96e1e5fa2a3a051a786fde2b7cd0bdd4344b1eb8
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/c3p0-config.xml"
@@ -0,0 +1,36 @@
+
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://192.168.121.162:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ root123
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://192.168.121.162:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ root123
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://localhost:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ root123
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/AddController.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/AddController.class"
new file mode 100644
index 0000000000000000000000000000000000000000..a922726e28f7dc574beb6f7b8dbdfe2e40fbc139
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/AddController.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/DeleteController.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/DeleteController.class"
new file mode 100644
index 0000000000000000000000000000000000000000..d97d9548e75d449667d0c96be8ca5d194d643362
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/DeleteController.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/LoginController.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/LoginController.class"
new file mode 100644
index 0000000000000000000000000000000000000000..89a4ea7997ee437bb97b21d9a57fb46d1dae0500
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/LoginController.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/QueryController.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/QueryController.class"
new file mode 100644
index 0000000000000000000000000000000000000000..5d8ef87399bdde2c98a7be1ceaf2fc4586840133
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/QueryController.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/RegisterController.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/RegisterController.class"
new file mode 100644
index 0000000000000000000000000000000000000000..63c0f3b1ad96c43b463102ed1c8fafa2327e4c39
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/RegisterController.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/UpdateController.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/UpdateController.class"
new file mode 100644
index 0000000000000000000000000000000000000000..9ce50e366a5acd6bcaf649289da4dfac4602e00f
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/UpdateController.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/UserController.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/UserController.class"
new file mode 100644
index 0000000000000000000000000000000000000000..d082af716f2280107c8a67bfde02c35adaa9546a
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/controller/UserController.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/dao/UserDao.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/dao/UserDao.class"
new file mode 100644
index 0000000000000000000000000000000000000000..f448869e5096d1d23b8848b04c8c04bd6f2c9463
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/dao/UserDao.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/dao/impl/UserDaoImpl.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/dao/impl/UserDaoImpl.class"
new file mode 100644
index 0000000000000000000000000000000000000000..70cf5f807e644f4af8a640f9375701a287bb6412
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/dao/impl/UserDaoImpl.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/dao/impl/UserDaoImpl2.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/dao/impl/UserDaoImpl2.class"
new file mode 100644
index 0000000000000000000000000000000000000000..8af6cefc2c70a94e012513307cc4f87fee8eed2b
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/dao/impl/UserDaoImpl2.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/entity/Users.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/entity/Users.class"
new file mode 100644
index 0000000000000000000000000000000000000000..6b98db7f1a9b05704921b39d464b60b5708c7f59
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/entity/Users.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/exception/IdIsNullException.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/exception/IdIsNullException.class"
new file mode 100644
index 0000000000000000000000000000000000000000..5301ed3a48a39fbaef10b7a3a3c8bb4e7736a1b9
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/exception/IdIsNullException.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/jdbc/JdbcDemo.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/jdbc/JdbcDemo.class"
new file mode 100644
index 0000000000000000000000000000000000000000..363a611414e5c5a749a94031dd531cfe3d1dbc4d
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/jdbc/JdbcDemo.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/service/UserService.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/service/UserService.class"
new file mode 100644
index 0000000000000000000000000000000000000000..cd769eb7e8b0d2d0a855056ec66e76f1c56fe671
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/service/UserService.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/service/impl/UserServiceImpl.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/service/impl/UserServiceImpl.class"
new file mode 100644
index 0000000000000000000000000000000000000000..034f0987821dde8032e0a7fde51e810718778be2
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/service/impl/UserServiceImpl.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/test/UserDaoImpl2Test.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/test/UserDaoImpl2Test.class"
new file mode 100644
index 0000000000000000000000000000000000000000..8508e790d72c742781b9c8e41791eb373de8fd75
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/test/UserDaoImpl2Test.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/test/UserDaoImplTest.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/test/UserDaoImplTest.class"
new file mode 100644
index 0000000000000000000000000000000000000000..2e8efcf32bc596bd8077851430d3716b39114565
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/test/UserDaoImplTest.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/test/UserServiceImplTest.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/test/UserServiceImplTest.class"
new file mode 100644
index 0000000000000000000000000000000000000000..61c82ab6886600fa4219244460573d1893868ec2
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/test/UserServiceImplTest.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/Base64Util.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/Base64Util.class"
new file mode 100644
index 0000000000000000000000000000000000000000..244d3e5239a192cab84221ac46b806df4781c90a
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/Base64Util.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/C3P0Util.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/C3P0Util.class"
new file mode 100644
index 0000000000000000000000000000000000000000..f1d4fed48de763a09de51e8b77fa152f8a157c7f
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/C3P0Util.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/DBHelper.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/DBHelper.class"
new file mode 100644
index 0000000000000000000000000000000000000000..fadca2fa57a5a17d6e1cf497352ef583a7a6b62c
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/DBHelper.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/JdbcUtil.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/JdbcUtil.class"
new file mode 100644
index 0000000000000000000000000000000000000000..f8852ccac2124189dc6d7d6b8943e5965d65e5c3
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/util/JdbcUtil.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Add.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Add.class"
new file mode 100644
index 0000000000000000000000000000000000000000..24e528dcb14b412679a5669432d3d145067ac7b4
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Add.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/AddMain.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/AddMain.class"
new file mode 100644
index 0000000000000000000000000000000000000000..34f55dbbf241f08d9310bda7dec4fc47af1dcd1b
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/AddMain.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Login.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Login.class"
new file mode 100644
index 0000000000000000000000000000000000000000..0ab1bae9271637e86e9bf08fb2a79a4de0925b81
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Login.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Main.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Main.class"
new file mode 100644
index 0000000000000000000000000000000000000000..cd412fcd6556811f7125c584941f8557c0b77443
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Main.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Manage.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Manage.class"
new file mode 100644
index 0000000000000000000000000000000000000000..7a13aaffc7243c4b7924c666bc063e349b7f85fc
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Manage.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Query.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Query.class"
new file mode 100644
index 0000000000000000000000000000000000000000..a3229e2da218c3ec46db9a318404a4c211a69da1
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Query.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/QueryMain.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/QueryMain.class"
new file mode 100644
index 0000000000000000000000000000000000000000..3704c84abca42a49cd2eeaf4df21dea7b64744b5
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/QueryMain.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Register.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Register.class"
new file mode 100644
index 0000000000000000000000000000000000000000..81ab339c71d4b3779adff2686e361bb8523d4333
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Register.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Update.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Update.class"
new file mode 100644
index 0000000000000000000000000000000000000000..7cec4af198689a65e28d752852d3f6f906d02889
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/Update.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/UpdateMain.class" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/UpdateMain.class"
new file mode 100644
index 0000000000000000000000000000000000000000..793ca8b2e9950a85edab5924bf3940e4cf952004
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/com/zm/view/UpdateMain.class" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/dbconfig.properties" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/dbconfig.properties"
new file mode 100644
index 0000000000000000000000000000000000000000..a83ddbd513db139096d68fad559b4c9bc5b1ce56
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/classes/dbconfig.properties"
@@ -0,0 +1,9 @@
+#mysql
+mysql.driverClass=com.mysql.jdbc.Driver
+mysql.url=jdbc:mysql://192.168.121.162:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+mysql.name=root
+mysql.pwd=root123
+
+#oracle
+
+#sqlserver
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/lib/c3p0-0.9.1.2-jdk1.3.jar" "b/\346\272\220\344\273\243\347\240\201/UserManage3/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/UserManage3/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/UserManage3/WebRoot/WEB-INF/lib/c3p0-0.9.1.2.jar" "b/\346\272\220\344\273\243\347\240\201/UserManage3/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/UserManage3/WebRoot/WEB-INF/lib/c3p0-0.9.1.2.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/lib/c3p0-oracle-thin-extras-0.9.1.2.jar" "b/\346\272\220\344\273\243\347\240\201/UserManage3/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/UserManage3/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/UserManage3/WebRoot/WEB-INF/lib/hamcrest-core-1.3.jar" "b/\346\272\220\344\273\243\347\240\201/UserManage3/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/UserManage3/WebRoot/WEB-INF/lib/hamcrest-core-1.3.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/lib/junit-4.12.jar" "b/\346\272\220\344\273\243\347\240\201/UserManage3/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/UserManage3/WebRoot/WEB-INF/lib/junit-4.12.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/lib/mysql-connector-java-5.1.40-bin.jar" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/lib/mysql-connector-java-5.1.40-bin.jar"
new file mode 100644
index 0000000000000000000000000000000000000000..60bef5cfbfbecf98b7371ba19389fe792be305e0
Binary files /dev/null and "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/lib/mysql-connector-java-5.1.40-bin.jar" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/web.xml" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/web.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..b1b308fd3bd858f89caa955a928499d38d1e5723
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/WEB-INF/web.xml"
@@ -0,0 +1,155 @@
+
+
+ UserManage3
+
+ LoginController
+ com.zm.controller.LoginController
+
+
+ UserController
+ com.zm.controller.UserController
+
+
+ Login
+ com.zm.view.Login
+
+
+ Main
+ com.zm.view.Main
+
+
+ Manage
+ com.zm.view.Manage
+
+
+ UpdateController
+ com.zm.controller.UpdateController
+
+
+ Update
+ com.zm.view.Update
+
+
+ UpdateMain
+ com.zm.view.UpdateMain
+
+
+ AddController
+ com.zm.controller.AddController
+
+
+ DeleteController
+ com.zm.controller.DeleteController
+
+
+ QueryController
+ com.zm.controller.QueryController
+
+
+ Add
+ com.zm.view.Add
+
+
+ AddMain
+ com.zm.view.AddMain
+
+
+ Query
+ com.zm.view.Query
+
+
+ QueryMain
+ com.zm.view.QueryMain
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ LoginController
+ /LoginController
+
+
+ UserController
+ /UserController
+
+
+ Login
+ /Login
+
+
+ Main
+ /Main
+
+
+ Manage
+ /Manage
+
+
+ UpdateController
+ /UpdateController
+
+
+ Update
+ /Update
+
+
+ UpdateMain
+ /UpdateMain
+
+
+ AddController
+ /AddController
+
+
+ DeleteController
+ /DeleteController
+
+
+ QueryController
+ /QueryController
+
+
+ Add
+ /Add
+
+
+ AddMain
+ /AddMain
+
+
+ Query
+ /Query
+
+
+ QueryMain
+ /QueryMain
+
+
+ Login
+
+
+ Register
+ com.zm.view.Register
+
+
+ RegisterController
+ com.zm.controller.RegisterController
+
+
+ RegisterController
+ /RegisterController
+
+
+ Register
+ /Register
+
+
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/css/comm.css" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/css/comm.css"
new file mode 100644
index 0000000000000000000000000000000000000000..68da0392fba143131517cdca07de6d1cdf3de1f9
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/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/UserManage3/WebRoot/css/main.css" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/css/main.css"
new file mode 100644
index 0000000000000000000000000000000000000000..8251ca6653a42f37764a0e63646c6cdaa7864851
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/css/main.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/UserManage3/WebRoot/css/manage.css" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/css/manage.css"
new file mode 100644
index 0000000000000000000000000000000000000000..f4aa21c3b4bf506ecdd72f7b4b2882a906a9daf9
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/css/manage.css"
@@ -0,0 +1,10 @@
+/*table{
+ border:1px solid black;
+ border-collapse:collapse;
+}*/
+
+.gray{
+ text-decoration:none;
+ color:gray;
+ font-style:italic;
+}
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/db/users(mysql).sql" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/db/users(mysql).sql"
new file mode 100644
index 0000000000000000000000000000000000000000..d065c62266f3ff96972763d800c9c3ee75d68e65
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/db/users(mysql).sql"
@@ -0,0 +1,56 @@
+/*
+Navicat MySQL Data Transfer
+
+Source Server : MySQL 5.6
+Source Server Version : 50621
+Source Host : 127.0.0.1:3306
+Source Database : test1
+
+Target Server Type : MYSQL
+Target Server Version : 50621
+File Encoding : 65001
+
+Date: 2023-10-11 20:26:02
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for users
+-- ----------------------------
+DROP TABLE IF EXISTS `users`;
+CREATE TABLE `users` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(30) DEFAULT NULL,
+ `nickName` varchar(30) DEFAULT NULL,
+ `pwd` varchar(24) DEFAULT NULL,
+ `gender` varchar(2) DEFAULT NULL,
+ `birthday` datetime DEFAULT NULL,
+ `hobby` varchar(50) DEFAULT NULL,
+ `tel` varchar(20) DEFAULT NULL,
+ `email` varchar(30) DEFAULT NULL,
+ `grade` int(11) DEFAULT '1',
+ `description` varchar(300) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
+
+-- ----------------------------
+-- Records of users
+-- ----------------------------
+INSERT INTO `users` VALUES ('1', '李逵', '黑旋风', '123', '1', '2001-01-01 00:00:00', '吃饭,睡觉,写程序', '13000000123', '123@qq.com', '1', '孝子');
+INSERT INTO `users` VALUES ('2', '宋江', '及时雨', '456', '1', '2002-02-02 00:00:00', '吃饭,睡觉', '13000000456', '456@qq.com', '100', '带头大哥');
+INSERT INTO `users` VALUES ('3', '林冲', '豹子头', '789', '1', '2003-03-03 00:00:00', '睡觉,写程序', '13000000789', '789@qq.com', '5', '八十万禁军教头');
+INSERT INTO `users` VALUES ('4', '吴用', '智多星', '123', '1', '2004-04-04 00:00:00', '吃饭,写程序', '13000000123', '123@qq.com', '99', '屡出奇谋,屡建战功');
+INSERT INTO `users` VALUES ('5', '武松', '行者', '456', '1', '2005-05-05 00:00:00', '吃饭,睡觉,写程序', '13000000456', '456@qq.com', '5', '打虎英雄');
+INSERT INTO `users` VALUES ('6', '杨志', '青面兽', '789', '1', '2006-06-06 00:00:00', '睡觉,写程序', '13000000789', '789@qq.com', '1', '杨家将后代');
+INSERT INTO `users` VALUES ('7', '鲁智深', '花和尚', '123', '1', '2007-07-07 00:00:00', '吃饭,睡觉', '13000000123', '123@qq.com', '5', '拳打镇关西');
+INSERT INTO `users` VALUES ('8', '阮小二', '立地太岁', '456', '1', '2008-08-08 00:00:00', '吃饭,睡觉,写程序', '13000000456', '456@qq.com', '5', '水军头领');
+INSERT INTO `users` VALUES ('9', '扈三娘', '一丈青', '789', '0', '2009-09-09 00:00:00', '睡觉,写程序', '13000000789', '789@qq.com', '1', '梁山第一女将');
+INSERT INTO `users` VALUES ('10', '卢俊义', '玉麒麟', '123', '1', '2010-10-10 00:00:00', '吃饭,睡觉,写程序', '13000000123', '123@qq.com', '99', '京城员外,二把手');
+INSERT INTO `users` VALUES ('11', '公孙胜', '入云龙', '456', '1', '2011-11-11 00:00:00', '吃饭,睡觉', '13000000456', '456@qq.com', '99', '罗真人的大徒弟');
+INSERT INTO `users` VALUES ('12', '戴宗', '神行太保', '789', '1', '2012-12-12 00:00:00', '睡觉,写程序', '13000000789', '789@qq.com', '5', '行走如飞,总探声息头领');
+INSERT INTO `users` VALUES ('13', '燕青', '浪子', '123', '1', '2013-01-13 00:00:00', '吃饭,睡觉,写程序', '13000000123', '123@qq.com', '1', '步军头领');
+INSERT INTO `users` VALUES ('14', '孙二娘', '母夜叉', '456', '0', '2014-01-14 00:00:00', '吃饭,睡觉', '13000000456', '456@qq.com', '1', '巾帼不让须眉');
+INSERT INTO `users` VALUES ('15', '时迁', '鼓上蚤', '789', '1', '2015-01-15 00:00:00', '睡觉,写程序', '13000000789', '789@qq.com', '1', '飞檐走壁');
+INSERT INTO `users` VALUES ('16', '花荣', '小李广', '123', '1', '2016-01-16 00:00:00', '吃饭,睡觉,写程序', '13000000123', '123@qq.com', '5', '百步穿杨');
+SET FOREIGN_KEY_CHECKS=1;
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/imgs/conch.gif" "b/\346\272\220\344\273\243\347\240\201/UserManage3/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/UserManage3/WebRoot/imgs/conch.gif" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/imgs/fish.gif" "b/\346\272\220\344\273\243\347\240\201/UserManage3/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/UserManage3/WebRoot/imgs/fish.gif" differ
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/js/1.js" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/js/1.js"
new file mode 100644
index 0000000000000000000000000000000000000000..1aef69e839dd6b030f7483167e0014ad07ba43ae
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/js/1.js"
@@ -0,0 +1,28 @@
+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) {
+
+ end.href = "javascript:void(0);";
+ next.href = "javascript:void(0);";
+
+ end.className = "gray";
+ next.className = "gray";
+
+ }
+
+}
\ No newline at end of file
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/login.html" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/login.html"
new file mode 100644
index 0000000000000000000000000000000000000000..1c237ddbda7ea8d1e312da60d5ac2db4488c8699
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/login.html"
@@ -0,0 +1,25 @@
+
+
+
+ hello
+
+
+
+
+
+
+
+
+
+
+ 用户登录
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/main.html" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/main.html"
new file mode 100644
index 0000000000000000000000000000000000000000..583f18ecf95a0f5f84f4dbb8e5dd1178be00bfd2
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/main.html"
@@ -0,0 +1,17 @@
+
+
+
+ succ
+
+
+
+
+
+
+
+
+
+
+ 登录成功
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/main2.html" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/main2.html"
new file mode 100644
index 0000000000000000000000000000000000000000..45863cdcbe2136bd1be1debdd8833116d2991767
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/main2.html"
@@ -0,0 +1,17 @@
+
+
+
+ successfully
+
+
+
+
+
+
+
+
+
+
+ 注册成功!
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/register.html" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/register.html"
new file mode 100644
index 0000000000000000000000000000000000000000..4b00421d284a574e6b08618117bfb76a615a83bb
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/register.html"
@@ -0,0 +1,42 @@
+
+
+
+ 用户注册
+
+
+
+
+
+
+
+
+
+
+ 用户注册
+
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/update.html" "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/update.html"
new file mode 100644
index 0000000000000000000000000000000000000000..13516ede714d27097136bdf98287d8d2e714b05a
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/WebRoot/update.html"
@@ -0,0 +1,42 @@
+
+
+
+ 修改
+
+
+
+
+
+
+
+
+
+
+ 修改
+ >
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/c3p0-config.xml" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/c3p0-config.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..96e1e5fa2a3a051a786fde2b7cd0bdd4344b1eb8
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/c3p0-config.xml"
@@ -0,0 +1,36 @@
+
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://192.168.121.162:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ root123
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://192.168.121.162:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ root123
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://localhost:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false
+ root
+ root123
+ 10
+ 30
+ 100
+ 10
+ 200
+
+
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/AddController.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/AddController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..f071273f3c506bc980cbc65b6e9152bb337b754d
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/AddController.java"
@@ -0,0 +1,81 @@
+package com.zm.controller;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.zm.entity.Users;
+import com.zm.service.UserService;
+import com.zm.service.impl.UserServiceImpl;
+
+public class AddController extends HttpServlet {
+
+ private UserService userService = new UserServiceImpl();
+
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
+
+ res.setContentType("text/html;charset=utf-8");
+ req.setCharacterEncoding("utf-8");
+
+ String name = req.getParameter("name");
+ String nickName = req.getParameter("nickName");
+ String pwd1 = req.getParameter("pwd1");
+ String pwd2 = req.getParameter("pwd2");
+ String gender = req.getParameter("gender");
+ String birthdayStr = req.getParameter("birthday");
+ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date birthday = null;
+
+ try {
+ birthday = dateFormat.parse(birthdayStr);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ String hobby = req.getParameter("hobby");
+ String tel = req.getParameter("tel");
+ String email = req.getParameter("email");
+ int grade=0;
+ try {
+ grade = Integer.parseInt(req.getParameter("grade"));
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ String description = req.getParameter("description");
+ Users users=new Users();
+ users.setName(name);
+ users.setNickName(nickName);
+ users.setPwd(pwd1);
+ users.setGender(gender);
+ users.setBirthday(birthday);
+ users.setHobby(hobby);
+ users.setEmail(email);
+ users.setTel(tel);
+ users.setDescription(description);
+ users.setGrade(grade);
+
+ // 注册验证
+ try{
+ int rs=userService.addUser(users);
+ req.getRequestDispatcher("/AddMain").forward(req, res);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ 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/UserManage3/src/com/zm/controller/DeleteController.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/DeleteController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..ff68e2be7d662e292198de3fa1eedaa9a4336fb6
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/DeleteController.java"
@@ -0,0 +1,50 @@
+package com.zm.controller;
+
+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;
+
+import com.zm.entity.Users;
+import com.zm.exception.IdIsNullException;
+import com.zm.service.UserService;
+import com.zm.service.impl.UserServiceImpl;
+
+public class DeleteController extends HttpServlet {
+
+ private 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");
+ Users users=new Users();
+ String userid=req.getParameter("id");
+ Integer id=null;
+ if(userid!=null)
+ {
+ id=Integer.parseInt(userid);
+ }
+
+ try {
+ int rs=userService.delUserById(id);
+ req.getRequestDispatcher("/UserController?pageNum=1&pageSize=15").forward(req, res);
+ } catch (IdIsNullException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ 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/UserManage3/src/com/zm/controller/LoginController.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/LoginController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..cf5ffade12332ac4bda8a6096796e20845797b8d
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/LoginController.java"
@@ -0,0 +1,72 @@
+package com.zm.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.zm.entity.Users;
+import com.zm.service.UserService;
+import com.zm.service.impl.UserServiceImpl;
+import com.zm.util.Base64Util;
+import com.zm.util.DBHelper;
+import com.zm.util.JdbcUtil;
+
+public class LoginController extends HttpServlet {
+
+ private 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();
+
+ }
+
+ 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/UserManage3/src/com/zm/controller/QueryController.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/QueryController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..3084fd1960b3a9a5ca04b1a10ed2b4a39a889d06
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/QueryController.java"
@@ -0,0 +1,40 @@
+package com.zm.controller;
+
+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;
+
+import com.zm.entity.Users;
+import com.zm.service.UserService;
+import com.zm.service.impl.UserServiceImpl;
+
+public class QueryController extends HttpServlet {
+
+ private UserService userService = new UserServiceImpl();
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
+ res.setContentType("text/html;charset=utf-8");
+ req.setCharacterEncoding("utf-8");
+
+ int id = Integer.parseInt(req.getParameter("id"));
+
+ try{
+ Users users=userService.querybyId(id);
+ req.setAttribute("users", users);
+ req.getRequestDispatcher("/QueryMain").forward(req, res);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+
+ 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/UserManage3/src/com/zm/controller/RegisterController.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/RegisterController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..5cd35c811e4d3393a0b88c230fc7567a6e4e3861
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/RegisterController.java"
@@ -0,0 +1,84 @@
+package com.zm.controller;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;
+import com.zm.entity.Users;
+import com.zm.exception.IdIsNullException;
+import com.zm.service.UserService;
+import com.zm.service.impl.UserServiceImpl;
+
+public class RegisterController extends HttpServlet {
+
+ private 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");
+ Users users=new Users();
+ String userid=req.getParameter("id");
+ Integer id=null;
+ if(userid!=null)
+ {
+ id=Integer.parseInt(userid);
+ }
+
+ String name = req.getParameter("name");
+ String nickName = req.getParameter("nickName");
+ String pwd1 = req.getParameter("pwd1");
+ String gender = req.getParameter("gender");
+ String birthdayStr = req.getParameter("birthday");
+ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date birthday = null;
+ try {
+ birthday = dateFormat.parse(birthdayStr);
+ } catch (java.text.ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.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");
+
+ users.setName(name);
+ users.setNickName(nickName);
+ users.setPwd(pwd1);
+ users.setGender(gender);
+ users.setBirthday(birthday);
+ users.setHobby(hobby);
+ users.setEmail(email);
+ users.setTel(tel);
+ users.setDescription(description);
+ users.setGrade(grade);
+
+ try {
+ int rs=userService.updateUserById(users,id);
+ req.getRequestDispatcher("/UpdateMain").forward(req, res);
+ } catch (IdIsNullException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ 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/UserManage3/src/com/zm/controller/UpdateController.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/UpdateController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..4409c5561d21babeb7e91b8833529ccebca1f2a0
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/UpdateController.java"
@@ -0,0 +1,84 @@
+package com.zm.controller;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;
+import com.zm.entity.Users;
+import com.zm.exception.IdIsNullException;
+import com.zm.service.UserService;
+import com.zm.service.impl.UserServiceImpl;
+
+public class UpdateController extends HttpServlet {
+
+ private 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");
+ Users users=new Users();
+ String userid=req.getParameter("id");
+ Integer id=null;
+ if(userid!=null)
+ {
+ id=Integer.parseInt(userid);
+ }
+
+ String name = req.getParameter("name");
+ String nickName = req.getParameter("nickName");
+ String pwd1 = req.getParameter("pwd1");
+ String gender = req.getParameter("gender");
+ String birthdayStr = req.getParameter("birthday");
+ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date birthday = null;
+ try {
+ birthday = dateFormat.parse(birthdayStr);
+ } catch (java.text.ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.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");
+
+ users.setName(name);
+ users.setNickName(nickName);
+ users.setPwd(pwd1);
+ users.setGender(gender);
+ users.setBirthday(birthday);
+ users.setHobby(hobby);
+ users.setEmail(email);
+ users.setTel(tel);
+ users.setDescription(description);
+ users.setGrade(grade);
+
+ try {
+ int rs=userService.updateUserById(users,id);
+ req.getRequestDispatcher("/UpdateMain").forward(req, res);
+ } catch (IdIsNullException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ 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/UserManage3/src/com/zm/controller/UserController.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/UserController.java"
new file mode 100644
index 0000000000000000000000000000000000000000..3d9bf210432b8e6223714f83ab11525aa2616562
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/controller/UserController.java"
@@ -0,0 +1,70 @@
+package com.zm.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.zm.entity.Users;
+import com.zm.service.UserService;
+import com.zm.service.impl.UserServiceImpl;
+import com.zm.util.Base64Util;
+import com.zm.util.DBHelper;
+import com.zm.util.JdbcUtil;
+
+public class UserController extends HttpServlet {
+
+ private 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);
+
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/dao/UserDao.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/dao/UserDao.java"
new file mode 100644
index 0000000000000000000000000000000000000000..b35c6aa6aacfe71d77444d9acc646eb4c3ab7c80
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/dao/UserDao.java"
@@ -0,0 +1,68 @@
+package com.zm.dao;
+
+import java.util.ArrayList;
+
+import com.zm.entity.Users;
+import com.zm.exception.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);
+
+ /**
+ * 根据id查询单个用户的所有信息
+ * @param id
+ * @return
+ */
+ public Users querybyId(Integer id);
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/dao/impl/UserDaoImpl.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/dao/impl/UserDaoImpl.java"
new file mode 100644
index 0000000000000000000000000000000000000000..bc38c7c3de0219ba205d3286843a27f2e7cd979b
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/dao/impl/UserDaoImpl.java"
@@ -0,0 +1,80 @@
+package com.zm.dao.impl;
+
+import java.sql.ResultSet;
+import java.util.ArrayList;
+
+import com.zm.dao.UserDao;
+import com.zm.entity.Users;
+import com.zm.exception.IdIsNullException;
+import com.zm.util.Base64Util;
+import com.zm.util.DBHelper;
+import com.zm.util.JdbcUtil;
+
+public class UserDaoImpl implements UserDao {
+
+ @Override
+ public int addUser(Users users) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int delUserById(Integer id) throws IdIsNullException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int updateUserById(Users users, Integer id) throws IdIsNullException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public ArrayList getAllUsers() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean checkUser(Users users) {
+ boolean flag = false;
+
+ try {
+ // 1、加载驱动
+ // 2、获得数据库连接
+ // 3、创建表示sql的语句对象
+ // 4、执行sql,如果有结果,写入结果集
+ String sql = "select * from users where name=? and pwd=?";
+ Object[] params = {users.getName(), Base64Util.encode(users.getPwd())};
+ ResultSet rs = DBHelper.executeQuery(sql, params);
+ // 5、遍历结果集
+ flag = rs.next();
+ // 6、关闭资源
+ JdbcUtil.release(DBHelper.getConn(), DBHelper.getPs(), rs); //?
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return flag;
+ }
+
+ @Override
+ public ArrayList getPageUsers(int pageNum, int pageSize) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getPageCount() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public Users querybyId(Integer id) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/dao/impl/UserDaoImpl2.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/dao/impl/UserDaoImpl2.java"
new file mode 100644
index 0000000000000000000000000000000000000000..880a852f35879c82d88f9f26ccf4aabb726e477e
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/dao/impl/UserDaoImpl2.java"
@@ -0,0 +1,238 @@
+package com.zm.dao.impl;
+
+import java.sql.ResultSet;
+import java.util.ArrayList;
+
+import com.zm.dao.UserDao;
+import com.zm.entity.Users;
+import com.zm.exception.IdIsNullException;
+import com.zm.util.Base64Util;
+import com.zm.util.C3P0Util;
+import com.zm.util.DBHelper;
+import com.zm.util.JdbcUtil;
+
+public class UserDaoImpl2 implements UserDao {
+
+ @Override
+ public int addUser(Users users) {
+
+ int row = 0;
+ try {
+ String sql = "insert into users(name,nickName,pwd,gender,birthday,hobby,tel,email,grade,description)values(?,?,?,?,?,?,?,?,?,?)";
+ Object[] params = { users.getName(), users.getNickName(), Base64Util.encode(users.getPwd()),
+ users.getGender(), users.getBirthday(), users.getHobby(), users.getTel(), users.getEmail(),
+ users.getGrade(), users.getDescription() };
+ row = DBHelper.executeUpdate(sql, params);
+ // 5、遍历结果集
+ // 6、关闭资源
+ C3P0Util.release(DBHelper.getConn(), DBHelper.getPs(), null); // ?
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return row;
+ }
+
+ @Override
+ public int delUserById(Integer id) throws IdIsNullException {
+
+ int row = 0;
+ try {
+ String sql = "delete from users where id =?";
+ Object[] params = { id };
+ row = DBHelper.executeUpdate(sql, params);
+ // 5、遍历结果集
+ // 6、关闭资源
+ C3P0Util.release(DBHelper.getConn(), DBHelper.getPs(), null); // ?
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return row;
+ }
+
+ @Override
+ public int updateUserById(Users users, Integer id) throws IdIsNullException {
+ int row = 0;
+
+ try {
+ String sql = "update users set name=?,nickName=?,pwd=?,gender=?,birthday=?,hobby=?,tel=?,email=?,grade=?,description=? where id=?";
+ Object[] params = { users.getName(), users.getNickName(), Base64Util.encode(users.getPwd()),
+ users.getGender(), users.getBirthday(), users.getHobby(), users.getTel(), users.getEmail(),
+ users.getGrade(), users.getDescription(), id };
+ row = DBHelper.executeUpdate(sql, params);
+ // 5、遍历结果集
+ // 6、关闭资源
+ C3P0Util.release(DBHelper.getConn(), DBHelper.getPs(), null); // ?
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return row;
+ }
+
+ @Override
+ public ArrayList getAllUsers() {
+
+ ArrayList list = null;
+
+ try {
+ String sql = "select * from users";
+ Object[] params = null;
+ ResultSet rs = DBHelper.executeQuery(sql, params);
+ // 5、遍历结果集
+
+ if (rs.next()) {
+ list = new ArrayList();
+ do {
+ // 封装users
+ Users users = new Users();
+
+ users.setId(rs.getInt("id"));
+ users.setName(rs.getString("name"));
+ users.setNickName(rs.getString("nickName"));
+ users.setPwd(rs.getString("pwd"));
+ users.setGender(rs.getString("gender"));
+ users.setBirthday(rs.getDate("birthday"));
+ users.setHobby(rs.getString("hobby"));
+ users.setTel(rs.getString("tel"));
+ users.setEmail(rs.getString("email"));
+ users.setGrade(rs.getInt("grade"));
+ users.setDescription(rs.getString("description"));
+
+ // 加入list
+ list.add(users);
+ } while (rs.next());
+ }
+
+ // 6、关闭资源
+ C3P0Util.release(DBHelper.getConn(), DBHelper.getPs(), rs); // ?
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return list;
+ }
+
+ @Override
+ public boolean checkUser(Users users) {
+ boolean flag = false;
+
+ try {
+ // 1、加载驱动
+ // 2、获得数据库连接
+ // 3、创建表示sql的语句对象
+ // 4、执行sql,如果有结果,写入结果集
+ String sql = "select * from users where name=? and pwd=?";
+ Object[] params = { users.getName(), Base64Util.encode(users.getPwd()) };
+ ResultSet rs = DBHelper.executeQuery(sql, params);
+ // 5、遍历结果集
+ flag = rs.next();
+ // 6、关闭资源
+ C3P0Util.release(DBHelper.getConn(), DBHelper.getPs(), rs); // ?
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return flag;
+ }
+
+ @Override
+ public ArrayList getPageUsers(int pageNum, int pageSize) {
+
+ ArrayList list = null;
+
+ try {
+ String sql = "select * from users limit ?,?";
+ Object[] params = { (pageNum - 1) * pageSize, pageSize };
+ ResultSet rs = DBHelper.executeQuery(sql, params);
+ // 5、遍历结果集
+
+ if (rs.next()) {
+ list = new ArrayList();
+ do {
+ // 封装users
+ Users users = new Users();
+
+ users.setId(rs.getInt("id"));
+ users.setName(rs.getString("name"));
+ users.setNickName(rs.getString("nickName"));
+ users.setPwd(rs.getString("pwd"));
+ users.setGender(rs.getString("gender"));
+ users.setBirthday(rs.getDate("birthday"));
+ users.setHobby(rs.getString("hobby"));
+ users.setTel(rs.getString("tel"));
+ users.setEmail(rs.getString("email"));
+ users.setGrade(rs.getInt("grade"));
+ users.setDescription(rs.getString("description"));
+
+ // 加入list
+ list.add(users);
+ } while (rs.next());
+ }
+
+ // 6、关闭资源
+ C3P0Util.release(DBHelper.getConn(), DBHelper.getPs(), rs); // ?
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return list;
+
+ }
+
+ @Override
+ public int getPageCount() {
+
+ int res = -1;
+
+ try {
+ String sql = "select count(*) from users";
+ Object[] params = null;
+ ResultSet rs = DBHelper.executeQuery(sql, params);
+ // 5、遍历结果集
+ rs.next();
+
+ res = rs.getInt(1);
+
+ // 6、关闭资源
+ C3P0Util.release(DBHelper.getConn(), DBHelper.getPs(), rs); // ?
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return res;
+
+ }
+
+ @Override
+ public Users querybyId(Integer id) {
+ Users users = new Users();
+
+ try {
+ String sql = "select * from users where id =?";
+ Object[] params = { id };
+ ResultSet rs = DBHelper.executeQuery(sql, params);
+ // 5、遍历结果集
+ rs.next();
+ users.setId(rs.getInt("id"));
+ users.setName(rs.getString("name"));
+ users.setNickName(rs.getString("nickName"));
+ users.setPwd(rs.getString("pwd"));
+ users.setGender(rs.getString("gender"));
+ users.setBirthday(rs.getDate("birthday"));
+ users.setHobby(rs.getString("hobby"));
+ users.setTel(rs.getString("tel"));
+ users.setEmail(rs.getString("email"));
+ users.setGrade(rs.getInt("grade"));
+ users.setDescription(rs.getString("description"));
+ // 6、关闭资源
+ C3P0Util.release(DBHelper.getConn(), DBHelper.getPs(), rs); // ?
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+
+ return users;
+ }
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/entity/Users.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/entity/Users.java"
new file mode 100644
index 0000000000000000000000000000000000000000..f2b38d0d19c3a8f5053c9dd3ea9aac23341cb508
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/entity/Users.java"
@@ -0,0 +1,94 @@
+package com.zm.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;
+ 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/UserManage3/src/com/zm/exception/IdIsNullException.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/exception/IdIsNullException.java"
new file mode 100644
index 0000000000000000000000000000000000000000..b55fda4ac800248ce5afd32e2d45de0c5c9df7b8
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/exception/IdIsNullException.java"
@@ -0,0 +1,30 @@
+package com.zm.exception;
+
+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
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/jdbc/JdbcDemo.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/jdbc/JdbcDemo.java"
new file mode 100644
index 0000000000000000000000000000000000000000..473d2b8d2b4a71be152e9f4931798357dc3f30a7
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/jdbc/JdbcDemo.java"
@@ -0,0 +1,40 @@
+package com.zm.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.121.162:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false", "root", "root");
+ // 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','吃饭,睡觉,写程序','13900000001','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/UserManage3/src/com/zm/service/UserService.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/service/UserService.java"
new file mode 100644
index 0000000000000000000000000000000000000000..929d03244832b59bf8ad5d11865c56383213378e
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/service/UserService.java"
@@ -0,0 +1,66 @@
+package com.zm.service;
+
+import java.util.ArrayList;
+
+import com.zm.entity.Users;
+import com.zm.exception.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);
+
+ /**
+ * 根据id查询单个用户
+ * @param id
+ * @return
+ */
+ public Users querybyId(Integer id);
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/service/impl/UserServiceImpl.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/service/impl/UserServiceImpl.java"
new file mode 100644
index 0000000000000000000000000000000000000000..225e7fb13efcf6842932b15cad3a2fdf3d3a682d
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/service/impl/UserServiceImpl.java"
@@ -0,0 +1,58 @@
+package com.zm.service.impl;
+
+import java.util.ArrayList;
+
+import com.zm.dao.UserDao;
+import com.zm.dao.impl.UserDaoImpl;
+import com.zm.dao.impl.UserDaoImpl2;
+import com.zm.entity.Users;
+import com.zm.exception.IdIsNullException;
+import com.zm.service.UserService;
+
+public class UserServiceImpl implements UserService {
+
+ private UserDao userDao = new UserDaoImpl2();
+
+ @Override
+ public int addUser(Users users) {
+ return userDao.addUser(users);
+ }
+
+ @Override
+ public int delUserById(Integer id) throws IdIsNullException {
+
+ return userDao.delUserById(id);
+ }
+
+ @Override
+ public int updateUserById(Users users, Integer id) throws IdIsNullException {
+ return userDao.updateUserById(users, id);
+ }
+
+ @Override
+ public ArrayList getAllUsers() {
+ return userDao.getAllUsers();
+ }
+
+ @Override
+ public boolean checkUser(Users users) {
+ return userDao.checkUser(users);
+ }
+
+ @Override
+ public ArrayList getPageUsers(int pageNum, int pageSize) {
+ return userDao.getPageUsers(pageNum, pageSize);
+ }
+
+ @Override
+ public int getPageCount() {
+ return userDao.getPageCount();
+ }
+
+ @Override
+ public Users querybyId(Integer id) {
+
+ return userDao.querybyId(id);
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/test/UserDaoImpl2Test.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/test/UserDaoImpl2Test.java"
new file mode 100644
index 0000000000000000000000000000000000000000..8128c4577ea9c4818c9e71822370b04114aa9799
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/test/UserDaoImpl2Test.java"
@@ -0,0 +1,133 @@
+package com.zm.test;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import org.junit.Test;
+
+import com.zm.dao.UserDao;
+import com.zm.dao.impl.UserDaoImpl;
+import com.zm.dao.impl.UserDaoImpl2;
+import com.zm.entity.Users;
+import com.zm.exception.IdIsNullException;
+
+public class UserDaoImpl2Test {
+
+ private UserDao userDao = new UserDaoImpl2();
+
+ @Test
+ public void testAddUser() {
+ Users users = new Users();
+ Date date=new Date(600000);
+ users.setName("宋铁");
+ users.setPwd("123");
+ users.setNickName("铁铁");
+ users.setBirthday(date);
+ users.setGender("0");
+ users.setHobby("吃饭");
+ users.setTel("12345678999");
+ users.setEmail("11@12.com");
+ users.setGrade(4);
+ users.setDescription("666666");
+
+ int res = userDao.addUser(users);
+
+ System.out.println("res=" + res);
+
+ // 断言
+ assertNotEquals(res, 0);
+ }
+
+ @Test
+ public void testDelUserById() throws IdIsNullException {
+ int res=userDao.delUserById(4);
+ System.out.println("res=" + res);
+
+ // 断言
+ assertNotEquals(res, 0);
+ }
+
+ @Test
+ public void testUpdateUserById() throws Exception {
+ Users users = new Users();
+ Date date=new Date(600000);
+ users.setName("宋铁");
+ users.setPwd("123");
+ users.setNickName("铁铁");
+ users.setBirthday(date);
+ users.setGender("0");
+ users.setHobby("吃饭");
+ users.setTel("12345678999");
+ users.setEmail("11@12.com");
+ users.setGrade(4);
+ users.setDescription("666666");
+
+ int res = userDao.updateUserById(users, 1);
+
+ System.out.println("res=" + res);
+
+ // 断言
+ assertNotEquals(res, 0);
+ }
+
+ @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 res = userDao.checkUser(users);
+
+ System.out.println("res=" + res);
+
+ // 断言
+ assertEquals(res, true);
+ }
+
+ @Test
+ public void testGetPageCount() {
+
+ int res = userDao.getPageCount();
+
+ System.out.println("res=" + res);
+
+ // 断言
+ assertNotEquals(res, 0);
+ }
+ @Test
+ public void testquerybyId(){
+ Users res = userDao.querybyId(2);
+
+ System.out.println("res=" + res.getId());
+
+ // 断言
+ assertNotEquals(res, null);
+
+ }
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/test/UserDaoImplTest.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/test/UserDaoImplTest.java"
new file mode 100644
index 0000000000000000000000000000000000000000..4d9c4d2efc4a0a9201ab2c097cdc56cd151b82b9
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/test/UserDaoImplTest.java"
@@ -0,0 +1,50 @@
+package com.zm.test;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import com.zm.dao.UserDao;
+import com.zm.dao.impl.UserDaoImpl;
+import com.zm.entity.Users;
+
+public class UserDaoImplTest {
+
+ private 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 res = userDao.checkUser(users);
+
+ System.out.println("res=" + res);
+
+ // 断言
+ assertEquals(res, true);
+ }
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/test/UserServiceImplTest.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/test/UserServiceImplTest.java"
new file mode 100644
index 0000000000000000000000000000000000000000..7cb6fc569d70c08713c2cb8e51a9d501cb78625a
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/test/UserServiceImplTest.java"
@@ -0,0 +1,132 @@
+package com.zm.test;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import org.junit.Test;
+
+import com.zm.entity.Users;
+import com.zm.exception.IdIsNullException;
+import com.zm.service.UserService;
+import com.zm.service.impl.UserServiceImpl;
+
+public class UserServiceImplTest {
+
+ private UserService userService = new UserServiceImpl();
+
+ @Test
+ public void testAddUser() {
+ Users users = new Users();
+ Date date=new Date(600000);
+ users.setName("宋铁");
+ users.setPwd("123");
+ users.setNickName("铁铁");
+ users.setBirthday(date);
+ users.setGender("0");
+ users.setHobby("吃饭");
+ users.setTel("12345678999");
+ users.setEmail("11@12.com");
+ users.setGrade(4);
+ users.setDescription("666666");
+
+ int res = userService.addUser(users);
+
+ System.out.println("res=" + res);
+
+ // 断言
+ assertNotEquals(res, 0);
+ }
+
+ @Test
+ public void testDelUserById() throws IdIsNullException {
+ int res=userService.delUserById(3);
+ System.out.println("res=" + res);
+
+ // 断言
+ assertNotEquals(res, 0);
+ }
+
+ @Test
+ public void testUpdateUserById() throws IdIsNullException {
+ Users users = new Users();
+ Date date=new Date(600000);
+ users.setName("宋铁");
+ users.setPwd("123");
+ users.setNickName("铁铁");
+ users.setBirthday(date);
+ users.setGender("0");
+ users.setHobby("吃饭");
+ users.setTel("12345678999");
+ users.setEmail("11@12.com");
+ users.setGender("4");
+ users.setDescription("666666");
+
+ int res = userService.updateUserById(users, 1);
+
+ System.out.println("res=" + res);
+
+ // 断言
+ assertNotEquals(res, null);
+ }
+
+ @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 res = userService.checkUser(users);
+
+ System.out.println("res=" + res);
+
+ // 断言
+ assertEquals(res, true);
+ }
+
+ @Test
+ public void testGetPageCount() {
+
+ int res = userService.getPageCount();
+
+ System.out.println("res=" + res);
+
+ // 断言
+ assertNotEquals(res, 0);
+ }
+ @Test
+ public void testquerybyId(){
+ Users res = userService.querybyId(2);
+
+ System.out.println("res=" + res.getId());
+
+ // 断言
+ assertNotEquals(res, null);
+
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/Base64Util.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/Base64Util.java"
new file mode 100644
index 0000000000000000000000000000000000000000..3f7356e4180a8f216109dfb587627f406bf55ca9
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/Base64Util.java"
@@ -0,0 +1,37 @@
+package com.zm.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 = "ladhgahdgklaldgkla";
+
+ System.out.println(encode(x));
+ System.out.println(encode(y));
+ }
+
+}
diff --git "a/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/C3P0Util.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/C3P0Util.java"
new file mode 100644
index 0000000000000000000000000000000000000000..f840e194eadcab75589f7728aeaf05438d4ac6cb
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/C3P0Util.java"
@@ -0,0 +1,87 @@
+package com.zm.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 String driverClass;
+ private static String url;
+ private static String name;
+ private static String pwd;
+ private static ComboPooledDataSource cpds = new ComboPooledDataSource("mysql");
+
+ static {
+
+ try {
+
+// cpds.setDriverClass( "com.mysql.jdbc.Driver" );
+// cpds.setJdbcUrl( "jdbc:mysql://localhost:3306/test1?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8&useSSL=false" );
+// cpds.setUser("root");
+// cpds.setPassword("root");
+
+
+// driverClass = props.getProperty("mysql.driverClass");
+// url = props.getProperty("mysql.url");
+// name = props.getProperty("mysql.name");
+// pwd = props.getProperty("mysql.pwd");
+
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ 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/UserManage3/src/com/zm/util/DBHelper.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/DBHelper.java"
new file mode 100644
index 0000000000000000000000000000000000000000..ae3ac2b51864bc1467f4d99bf1dbf35684520cd0
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/DBHelper.java"
@@ -0,0 +1,65 @@
+package com.zm.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/UserManage3/src/com/zm/util/JdbcUtil.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/JdbcUtil.java"
new file mode 100644
index 0000000000000000000000000000000000000000..cde12f937c70c4fc9f38384b35f86a6edb8a7efb
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/util/JdbcUtil.java"
@@ -0,0 +1,90 @@
+package com.zm.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/UserManage3/src/com/zm/view/Add.java" "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/view/Add.java"
new file mode 100644
index 0000000000000000000000000000000000000000..5ada76c2397072c7be58dad81abfde1a6f0deca6
--- /dev/null
+++ "b/\346\272\220\344\273\243\347\240\201/UserManage3/src/com/zm/view/Add.java"
@@ -0,0 +1,50 @@
+package com.zm.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 Add 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("用户添加