Code example for ResultSet

Methods: getString, getTimestamp, next

0
	 */ 
	private OpenIDRememberMeDO buildRememberMeDO(ResultSet results, String username) {
 
		OpenIDRememberMeDO remDO = new OpenIDRememberMeDO();
		try { 
			if (!results.next()) {
				log.debug("RememberMe token not found for the user " + username);
				return remDO;
			} 
			remDO.setUserName(results.getString(1));
			remDO.setToken(results.getString(3));
			remDO.setTimestamp(results.getTimestamp(4));
 
		} catch (SQLException e) {
			log.error("Failed to create RememberMeDO for the user " + username +
			          ". Error while accessing the database", e);
		} finally { 
			IdentityDatabaseUtil.closeResultSet(results);
		} 
		return remDO;
	}