Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Account login(Account account){
- try{
- ResultSet rs = database.executeQuery(
- "select * from accounts" +
- " where username ='" + account.getUsename() + "' and"+
- " password ='"+ account.getPassword() + "'" +
- " limit 1"
- );
- if (!rs.last()) {
- return null;
- }else{
- account.setPerson(person.findBy("id", rs.getInt("person_id") + ""));
- account.setRole(role.findBy("id", rs.getInt("role_id") + ""));
- account.setId(rs.getInt("id"));
- account.setState(rs.getInt("state"));
- }
- }
- catch(Exception e){
- System.out.println(e);
- return null;
- }
- return account;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement