Package hotel.model

Examples of hotel.model.User


  @Override
  public User login(String username, String password, int type) {
    Connection conn = null;
    PreparedStatement ps = null;
    ResultSet rs = null;
    User user = null;
    String sql = "select * from userinfo where username = ? and password = ? and type = ?";
    try {
      conn = JdbcUtil.getConnection();
      ps = conn.prepareStatement(sql);
      ps.setString(1, username);
      ps.setString(2, password);
      ps.setInt(3, type);
      rs = ps.executeQuery();
      if (rs.next()) {
        String a = rs.getString("username");
        String b = rs.getString("password");
        String c = rs.getString("telephone");
        int i = rs.getInt("type");
        user = new User(a, b, c, i);
      }
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      JdbcUtil.free(rs, ps, conn);
View Full Code Here

TOP

Related Classes of hotel.model.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.