为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

数据库登录系统代码

2017-12-03 38页 doc 104KB 25阅读

用户头像

is_105949

暂无简介

举报
数据库登录系统代码数据库登录系统代码 1、UserInfo.java package ths.login.domain; public class UserInfo { private int id; private String name; private String password; private String email; private String birthday; public int getId() { return id; } public void setId(int id) { this.i...
数据库登录系统代码
数据库登录系统代码 1、UserInfo.java package ths.login.domain; public class UserInfo { private int id; private String name; private String password; private String email; private String birthday; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getBirthday() { return birthday; } public void setBirthday(String birthday) { this.birthday = birthday; } } steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury 2、 package ths.manager.servlet; import java.io.IOException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import ths.login.domain.UserInfo; import ths.struts.userdao.UserDAO; import ths.struts.userdao.impl.UserDAOImpl; @SuppressWarnings("serial") public class ManagerDeleteServlet extends HttpServlet { @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { UserDAO userDAO=new UserDAOImpl(); request.setCharacterEncoding("utf-8"); String ID=request.getParameter("id"); boolean flag=userDAO.deleteUser(ID); List list=userDAO.findAllUser(); if(flag){ request.setAttribute("deleteMessage", "恭喜您,删除成功!!!"); request.setAttribute("userinfo", list); request.getRequestDispatcher("/WEB-INF/jsp/managerSuccess.jsp").forward(request, response); } else{ request.setAttribute("deleteMessage", "对不起,删除失败!

您要删除的用户不存在!"); request.setAttribute("userinfo", list); steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury request.getRequestDispatcher("/WEB-INF/jsp/managerSuccess.jsp").forward(request, response); } } } 3、package ths.struts.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; public class RegisterFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { System.out.println("init"); // TODO Auto-generated method stub } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); chain.doFilter(request, response); } @Override public void destroy() { System.out.println("destroy"); } } steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury package ths.struts.login; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import ths.struts.userdao.UserDAO; import ths.struts.userdao.impl.UserDAOImpl; public class LoginAction extends Action { UserDAO userDAO=new UserDAOImpl(); @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { LoginForm loginForm=(LoginForm)form; String returnURLKeyWord=""; if(userDAO.find(loginForm)){ request.setAttribute("username", loginForm.getUsername()); request.setAttribute("password", loginForm.getPassword()); returnURLKeyWord="LoginSuccess"; } else{ returnURLKeyWord="LoginFailure"; } return mapping.findForward(returnURLKeyWord); } } package ths.struts.login; import org.apache.struts.action.ActionForm; @SuppressWarnings("serial") public class LoginForm extends ActionForm { private String username; private String password; steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } package ths.struts.register; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import ths.struts.userdao.UserDAO; import ths.struts.userdao.impl.UserDAOImpl; public class RegisterAction extends Action { UserDAO userDAO=new UserDAOImpl(); @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { RegisterForm registerForm=(RegisterForm)form; String returnURLKeyWord=""; if(userDAO.add(registerForm)){ returnURLKeyWord="RegisterSuccess"; steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury } else{ returnURLKeyWord="RegisterFailure"; } return mapping.findForward(returnURLKeyWord); } } package ths.struts.register; import org.apache.struts.action.ActionForm; @SuppressWarnings("serial") public class RegisterForm extends ActionForm { private String username; private String password; private String confirmpass; private String mail; private java.sql.Date birthday; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getConfirmpass() { return confirmpass; } public void setConfirmpass(String confirmpass) { this.confirmpass = confirmpass; } public String getMail() { return mail; steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury } public void setMail(String mail) { this.mail = mail; } public java.sql.Date getBirthday() { return birthday; } public void setBirthday(java.sql.Date birthday) { this.birthday = birthday; } } package ths.struts.userdao; import java.util.List; import ths.login.domain.UserInfo; import ths.struts.login.LoginForm; import ths.struts.register.RegisterForm; public interface UserDAO { public boolean add(RegisterForm registerForm); public boolean find(LoginForm loginForm); public boolean find(String username,String password); public boolean update(String username,String password); public boolean findManager(String managerName,String managerPassword); public List findAllUser(); public boolean deleteUser(String id); } package ths.struts.userdao.impl; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import ths.login.domain.UserInfo; import ths.struts.jdbcutils.JdbcUtils; import ths.struts.login.LoginForm; import ths.struts.register.RegisterForm; import ths.struts.userdao.UserDAO; public class UserDAOImpl implements UserDAO { private JdbcUtils jdbcUtils=null; public UserDAOImpl(){ jdbcUtils=JdbcUtils.getInstance(); } @Override public boolean add(RegisterForm registerForm) { Connection conn=null; PreparedStatement preStatement=null; ResultSet resultSet=null; try { conn=jdbcUtils.getConnection(); conn.setAutoCommit(false); //判断用户名是否存在 String sqlSelect="select name,email from userinfo"; preStatement=conn.prepareStatement(sqlSelect); resultSet=preStatement.executeQuery(); while(resultSet.next()){ String name=resultSet.getString("name"); String email=resultSet.getString("email"); if(name.equals(registerForm.getUsername())||email.equals(registerForm.getMail())){ return false; } } //用户名不存在 String sqlUpdate="insert into userinfo(name,password,email,birthday)values(?,?,?,?)"; preStatement=conn.prepareStatement(sqlUpdate); preStatement.setString(1,registerForm.getUsername()); preStatement.setString(2,registerForm.getPassword()); preStatement.setString(3,registerForm.getMail()); steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury preStatement.setDate(4,registerForm.getBirthday()); int i=preStatement.executeUpdate(); if(i>0){ conn.commit(); return true; }else{ conn.rollback(); } } catch (SQLException e) { throw new RuntimeException(e); } finally{ jdbcUtils.free(conn, preStatement); } return false; } @Override public boolean find(LoginForm loginForm) { Connection conn=null; Statement statement=null; ResultSet resultSet=null; try { conn=jdbcUtils.getConnection(); statement=conn.createStatement(); String sql="select name,password from userinfo"; resultSet=statement.executeQuery(sql); while(resultSet.next()){ String username=resultSet.getString("name"); String password=resultSet.getString("password"); if(loginForm.getUsername()==null||loginForm.getPassword()==null){ break; } if(loginForm.getUsername().equals(username)&&loginForm.getPassword().equals(password )){ return true; } } } catch (SQLException e) { throw new RuntimeException(e); } finally{ jdbcUtils.free(conn, statement); steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury } return false; } @Override public boolean find(String username,String password){ if(username==null||password==null){ return false; } Connection conn=null; Statement statement=null; ResultSet resultSet=null; try { conn=jdbcUtils.getConnection(); statement=conn.createStatement(); String sql="select name,password from userinfo"; resultSet=statement.executeQuery(sql); while(resultSet.next()){ String DBusername=resultSet.getString("name"); String DBpassword=resultSet.getString("password"); if(DBusername.equals(username)&&DBpassword.equals(password)){ return true; } } } catch (SQLException e) { throw new RuntimeException(e); }finally{ jdbcUtils.free(conn, statement); } return false; } @Override public boolean update(String username,String password){ Connection conn=null; PreparedStatement preStatement=null; String sql="update userinfo set password=? where name=?"; try{ conn=jdbcUtils.getConnection(); conn.setAutoCommit(false); preStatement=conn.prepareStatement(sql); preStatement.setString(1, password); preStatement.setString(2,username); int i=preStatement.executeUpdate(); if(i>0){ steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury conn.commit(); return true; } else{ conn.rollback(); } }catch(SQLException e){ throw new RuntimeException(e); }finally{ jdbcUtils.free(conn, preStatement); } return false; } @Override public boolean findManager(String managerName, String managerPassword) { Connection conn=null; Statement statement=null; ResultSet resultSet=null; String sql="select name,password from manager"; try { conn=jdbcUtils.getConnection(); statement=conn.createStatement(); resultSet=statement.executeQuery(sql); while(resultSet.next()){ String _managerName=resultSet.getString("name"); String _managerPassword=resultSet.getString("password"); if(_managerName.equals(managerName)&&_managerPassword.equals(managerPassword)){ return true; } } } catch (SQLException e) { throw new RuntimeException(e); }finally{ jdbcUtils.free(conn, statement); } return false; } @Override public List findAllUser() { List list=new ArrayList(); UserInfo userInfo=null; Connection conn=null; steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury Statement statement=null; ResultSet resultSet=null; try { conn=jdbcUtils.getConnection(); statement=conn.createStatement(); String sql="select *from userinfo"; resultSet=statement.executeQuery(sql); while(resultSet.next()){ int id=resultSet.getInt("id"); String name=resultSet.getString("name"); String password=resultSet.getString("password"); String email=resultSet.getString("email"); Date birthday=resultSet.getDate("birthday"); userInfo=new UserInfo(); userInfo.setId(id); userInfo.setName(name); userInfo.setPassword(password); userInfo.setEmail(email); userInfo.setBirthday(changBirthday(birthday)); list.add(userInfo); } return list; } catch (SQLException e) { throw new RuntimeException(e); }finally{ jdbcUtils.free(conn, statement); } } private String changBirthday(Date birthday){ String stringBirthday=new SimpleDateFormat("yyyy年-MM月-dd日").format(birthday); return stringBirthday; } @Override public boolean deleteUser(String id) { Connection conn=null; PreparedStatement preStatement=null; try { conn=jdbcUtils.getConnection(); String sql="delete from userinfo where id=?"; preStatement=conn.prepareStatement(sql); preStatement.setInt(1, Integer.parseInt(id)); int i=preStatement.executeUpdate(); if(i>0){ steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury return true; } } catch (SQLException e) { throw new RuntimeException(e); }finally{ jdbcUtils.free(conn, preStatement); } return false; } } package ths.struts.jdbcutils; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; public class JdbcUtils { private static JdbcUtils jdbcUtils=null; private static final String DBDRIVER="oracle.jdbc.driver.OracleDriver"; private static final String DBURL="jdbc:oracle:thin:@localhost:1521:thomas"; private static final String DBUSERNAME="scott"; private static final String DBPASSWORD="perfect"; private JdbcUtils(){ }; static{ try { Class.forName(DBDRIVER); } catch (ClassNotFoundException e) { throw new ExceptionInInitializerError(e); } } public static JdbcUtils getInstance(){ if(jdbcUtils==null){ synchronized (JdbcUtils.class) { steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury if(jdbcUtils==null){ jdbcUtils=new JdbcUtils(); } } } return jdbcUtils; } public Connection getConnection() throws SQLException{ return DriverManager.getConnection(DBURL, DBUSERNAME, DBPASSWORD); } public void free(Connection conn,Statement statement){ if(conn!=null){ try { conn.close(); } catch (SQLException e) { throw new RuntimeException(e); }finally{ if(statement!=null){ try { statement.close(); } catch (SQLException e) { throw new RuntimeException(e); } } } } } } steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury steel welding procedure 6 SH3525-2004 petrochemical JB/ T4708-2000 of welding procedure qualification for steel pressure vessels 7 JB/4709-2000 8 JB4730-2005 pressure vessel welding procedures of steel pressure vessel NDT 9 JB/T4744-2000 steel pressure vessel products mechanical properties test of welded plate II, mechanical equipment installation engineering 1 GB150-98 2 GB50128-2005 vertical cylindrical steel pressure vessel steel welded specification for construction and acceptance of oil tank 3 JB/ T4735-1997 steel welded atmospheric pressure vessel 4 GB50231-2009 mechanical equipment installation engineering construction and acceptance specification for 5 GB50275-98 compressor, fan and pump installation engineering construction and acceptance specification for lifting 6 HG20201-2000 construction installation engineering construction standard 7, HG ... Pressure gauges, using an installed spark arrestor for acetylene cylinders, illegal carrying, using gas cylinders, each operator fined 20 Yuan. Gas bottle without the hot sun exposure measures, responsibilities of team a fine of 50 Yuan. (7) at height and the opening and provisional protective measures have been taken, the responsible unit fined 200 Yuan, construction person in charge a fine of 50 Yuan. (8) no permit to work and the job in accordance with the provisions, on the job unit fined 300 yuan, the unit will charge a fine of 100 Yuan. 7.5.3 accident penalties (1) injuries fatalities directly punished 1~2 million. Direct responsibility for the accident and have the corresponding responsibility of leadership, such as concerning administrative sanctions, should be brought to the company or the relevant Department. (2) personal injury
/
本文档为【数据库登录系统代码】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索