Code example for ResultSet

Methods: getDate, getLong, getString

0
    } 
 
    public class UserRowMapper implements ParameterizedRowMapper<User> { 
        public User mapRow(ResultSet rs, int rowNum) throws SQLException {
            User user = new User();
            user.setLoginName(rs.getString("LOGIN_NAME"));
            user.setUserID(rs.getLong("USER_ID"));
            user.setUserEmail(rs.getString("USER_EMAIL"));
            user.setUserDate(rs.getDate("USER_DATE"));
            user.setUserName(rs.getString("USER_NAME"));
            user.setUserPassword(rs.getString("USER_PASSWORD"));
            user.setAuthoritiesFromString(rs.getString("USER_AUTHORITY"));
 
            return user;
        } 
    } 
 
    public class UserPreparedStatementCreator 
        implements PreparedStatementCreator { 
        private User user;
        private String sql = "insert into T_USER(LOGIN_NAME, USER_NAME, USER_EMAIL, USER_PASSWORD, USER_DATE, USER_AUTHORITY) values(?,?,?,?,?, ?)";