顺德网站建设方案,400网站建设推广,网站开发的账务处理,附近培训电脑的地方JavaSwing用户信息管理系统 一、系统介绍二、功能展示1.管理员登陆2.用户信息查询3.用户信息添加4.用户信息修改5.用户信息删除 三、系统实现1.UserDao .java 四、其它1.其他系统实现 一、系统介绍
该系统实现了管理员系统登陆、用户信息查询、用户信息添加、用户信息修改、用… JavaSwing用户信息管理系统 一、系统介绍二、功能展示1.管理员登陆2.用户信息查询3.用户信息添加4.用户信息修改5.用户信息删除 三、系统实现1.UserDao .java 四、其它1.其他系统实现 一、系统介绍
该系统实现了管理员系统登陆、用户信息查询、用户信息添加、用户信息修改、用户信息删除。
二、功能展示
1.管理员登陆 2.用户信息查询 3.用户信息添加 4.用户信息修改 5.用户信息删除 三、系统实现
1.UserDao .java
package dao;import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import entity.User;
import util.DbUtils;public class UserDao {private Connection connnull;private PreparedStatement psnull;private ResultSet rsnull;//登陆public boolean login(String username,String password){String sqlselect * from t_user where username username and passwordpassword;ListUser listnew ArrayListUser();boolean istrue false;try {connDbUtils.getConnection();psconn.prepareStatement(sql);rsps.executeQuery();System.out.println(ps.toString());while(rs.next()){istruetrue;}DbUtils.close(rs, ps, conn); } catch (SQLException e) {e.printStackTrace();}return istrue;}//查询用户信息public ArrayListUser selectUser(String username) {ArrayListUser tag_Array new ArrayListUser();Connection conn null;try {conn DbUtils.getConnection();} catch (SQLException e1) {// TODO Auto-generated catch blocke1.printStackTrace();};String sql select * from t_user where username like % username %;PreparedStatement stm null;ResultSet rs null;try {stm conn.prepareStatement(sql);rs stm.executeQuery();while(rs.next()){User user new User();user.setUuid(rs.getString(uuid));user.setUsername(rs.getString(username));user.setPassword(rs.getString(password));tag_Array.add(user);} } catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}finally{try {DbUtils.close(rs, stm, conn);} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}}return tag_Array;}//添加用户信息public int addUser(String uuid,String username,String password){int result0;String sqlinsert into t_user(uuid,username,password) values(?,?,?);try {connDbUtils.getConnection();ps conn.prepareStatement(sql);ps.setString(1, uuid);ps.setString(2, username);ps.setString(3, password);result ps.executeUpdate();// 返回值代表收到影响的行数DbUtils.close(rs, ps, conn); } catch (SQLException e) {e.printStackTrace();}return result;}//修改用户信息public int updateUser(String uuid,String username,String password){int result0;String sqlupdate t_user set username?,password? where uuid ?;try {connDbUtils.getConnection();ps conn.prepareStatement(sql); ps.setString(1, username);ps.setString(2, password);ps.setString(3, uuid);result ps.executeUpdate();// 返回值代表收到影响的行数DbUtils.close(rs, ps, conn); } catch (SQLException e) {e.printStackTrace();}return result;}//删除public int DelUser(String uuid){int result0;String sqlDELETE from t_user where uuid uuid ;try {connDbUtils.getConnection();ps conn.prepareStatement(sql);result ps.executeUpdate();// 返回值代表收到影响的行数DbUtils.close(rs, ps, conn); } catch (SQLException e) {e.printStackTrace();}return result;}
}四、其它
1.其他系统实现
JavaSwing实现学生选课管理系统 JavaSwing图书管理系统