Example usage for java.sql ResultSet getInt

List of usage examples for java.sql ResultSet getInt

Introduction

In this page you can find the example usage for java.sql ResultSet getInt.

Prototype

int getInt(String columnLabel) throws SQLException;

Source Link

Document

Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language.

Usage

From source file:com.dai.jdbc.SelecaoJogoExtractor.java

public SelecaoJogo extractData(ResultSet resultSet) throws SQLException, DataAccessException {
    SelecaoJogo sl = new SelecaoJogo();
    sl.setIdJogo(resultSet.getInt("jogo_idjogo"));
    sl.setIdUtilizador(resultSet.getInt("utilizador_idutilizador"));

    return sl;/*from  ww  w  .j ava  2  s. co m*/
}

From source file:com.springapp.mvc.mappers.ProductRowMapper.java

@Override
public Product mapRow(ResultSet resultSet, int i) throws SQLException {

    Product product = new Product();
    product.setCode(resultSet.getInt("code"));
    product.setDesc(resultSet.getString("description"));
    product.setName(resultSet.getString("name"));
    return product;
}

From source file:org.smigo.message.JdbcMessageDao.java

@Override
public List<Message> getMessage(Locale locale, int from, int size) {
    final String whereParameter = locale.getLanguage() + "%";
    return jdbcTemplate.query(SELECT, new Object[] { whereParameter, from, size }, new RowMapper<Message>() {
        @Override/*from  w w w .  ja  v a  2 s.co  m*/
        public Message mapRow(ResultSet rs, int rowNum) throws SQLException {
            return new Message(rs.getInt("id"), rs.getString("text"), rs.getString("username"),
                    rs.getDate("createdate"));
        }
    });
}

From source file:org.apache.niolex.config.dao.impl.UserInfoRowMapper.java

/**
 * Override super method// w w  w  .j  a  v a 2 s . c om
 * @see org.springframework.jdbc.core.RowMapper#mapRow(java.sql.ResultSet, int)
 */
@Override
public UserInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
    UserInfo info = new UserInfo();
    info.setUserId(rs.getInt("urid"));
    info.setUserRole(rs.getString("urole"));
    return info;
}

From source file:cc.cicadabear.profile.infrastructure.jdbc.UserRowMapper.java

@Override
public User mapRow(ResultSet rs, int i) throws SQLException {
    User user = new User();

    user.id(rs.getInt("id"));
    user.guid(rs.getString("guid"));

    user.archived(rs.getBoolean("archived"));
    user.createTime(rs.getTimestamp("create_time").toLocalDateTime());

    user.email(rs.getString("email"));
    user.phone(rs.getString("phone"));

    user.password(rs.getString("password"));
    user.salt(rs.getString("salt"));
    user.setLocked(rs.getInt("locked"));
    user.setStatus(rs.getInt("status"));
    user.username(rs.getString("username"));

    user.lastLoginTime(rs.getTimestamp("last_login_time"));

    return user;//from  w ww.jav a2  s  . co m
}

From source file:com.recber.jdbc.UserExtractor.java

@Override
public User extractData(ResultSet resultSet) throws SQLException, DataAccessException {

    User user = new User();

    user.setUserId(resultSet.getInt(1));
    user.setFirstName(resultSet.getString(2));
    user.setLastName(resultSet.getString(3));
    user.setFace(resultSet.getString(4));
    user.setCity(resultSet.getString(5));

    return user;//from w  w  w.  ja v  a 2  s  .  c  o  m
}

From source file:BBDDMapper.RestauranteMapper.java

@Override
public Object mapRow(ResultSet rs, int i) throws SQLException {
    Restaurante rest = new Restaurante();
    rest.setIdRestaurante(rs.getInt("idRestaurante"));
    rest.setNombre(rs.getString("nombre"));
    rest.setEmail(rs.getString("email"));
    rest.setDireccion(rs.getString("direccion"));
    rest.setTelefono(rs.getString("telefono"));
    rest.setLatitud(rs.getString("latitud"));
    rest.setLongitud(rs.getString("longitud"));
    rest.setUsername(rs.getString("username"));
    rest.setWeb(rs.getString("web"));

    return rest;//from  ww  w .  ja va2  s .c  om
}

From source file:com.dai.jdbc.JogoExtractor.java

public Jogo extractData(ResultSet resultSet) throws SQLException, DataAccessException {

    Jogo jogo = new Jogo();

    jogo.setIdJogo(resultSet.getInt("idJogo"));
    jogo.setLocal(resultSet.getString("localJogo"));
    jogo.setData(resultSet.getString("dataJogo"));
    jogo.setHora(resultSet.getString("horaJogo"));
    jogo.setResultado(resultSet.getString("resultadoJogo"));
    jogo.setResultado(resultSet.getString("competicao"));

    return jogo;/*from   ww  w.j a va2  s . co  m*/
}

From source file:com.dai.jdbc.EscalaoExtractor.java

public Escalao extractData(ResultSet resultSet) throws SQLException, DataAccessException {
    Escalao escalao = new Escalao();
    escalao.setIdEscalao(resultSet.getInt("idEscalao"));
    escalao.setDesignacao(resultSet.getString("designacaoEscalao"));

    return escalao;
}

From source file:com.phideltcmu.recruiter.server.dao.mapper.InternalUserSetExtractor.java

@Override
public Object extractData(ResultSet resultSet) throws SQLException, DataAccessException {
    InternalUser user = new InternalUser();
    user.setDatabaseID(resultSet.getInt(1));
    user.setName(resultSet.getString(2));
    user.setAdmin(resultSet.getBoolean(3));
    return user;/*from   www .ja  va 2  s  . co  m*/
}