/** * Get the user object. Fetch the row from the table. */ public User getUserByName(String name) throws FtpException { Statement stmt = null; ResultSet rs = null; try { BaseUser user = selectUserByName(name); if(user != null) { // reset the password, not to be sent to API users user.setPassword(null); } return user; } catch (SQLException ex) { LOG.error("DbUserManager.getUserByName()", ex); throw new FtpException("DbUserManager.getUserByName()", ex); } finally { closeQuitely(rs); closeQuitely(stmt); } }
User userWithPassword = selectUserByName(user.getName());