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:Category_Manager.Category_Mapper.java

@Override
public Category mapRow(ResultSet rs, int rowNum) throws SQLException {
    Category category = new Category();
    category.setCid(rs.getInt("cid"));
    category.setCategory_name(rs.getString("category_name"));
    category.setGroup(rs.getString("group_name"));

    return category;
}

From source file:com.branded.holdings.qpc.repository.jdbc.JdbcPetRowMapper.java

@Override
public JdbcPet mapRow(ResultSet rs, int rownum) throws SQLException {
    JdbcPet pet = new JdbcPet();
    pet.setId(rs.getInt("id"));
    pet.setName(rs.getString("name"));
    Date birthDate = rs.getDate("birth_date");
    pet.setBirthDate(new DateTime(birthDate));
    pet.setTypeId(rs.getInt("type_id"));
    pet.setOwnerId(rs.getInt("owner_id"));
    return pet;//from w  w w .j  av  a2s.  co m
}

From source file:com.simpletasks.dao.impl.jdbc.UserMapper.java

public User mapRow(ResultSet resultSet, int i) throws SQLException {
    User user = new User();
    user.setId(resultSet.getInt(1));
    user.setEmail(resultSet.getString(2));
    user.setPassword(resultSet.getString(3));
    user.setName(resultSet.getString(4));
    user.setLastName(resultSet.getString(5));
    return user;/*from ww w .ja  va2s.  c o  m*/
}

From source file:nbadb.DAO.PlayerMapper.java

@Override
public Player mapRow(ResultSet rs, int i) throws SQLException {
    Player player = new Player();
    player.setPlayerID(rs.getInt("PlayerID"));
    player.setPlayerName(rs.getString("PlayerName"));
    player.setActivePlayer(rs.getString("ActivePlayer"));
    player.setPPG(rs.getFloat("PPG"));
    player.setAPG(rs.getFloat("APG"));
    player.setRPG(rs.getFloat("RPG"));

    return player;
}

From source file:com.home.ln_spring.ch8.dao.jdbc.annotation.SelectAllContacts.java

@Override
protected Contact mapRow(ResultSet rs, int i) throws SQLException {
    Contact contact = new Contact();

    contact.setId(rs.getInt("contact_id"));
    contact.setFirstName(rs.getString("first_name"));
    contact.setLastName(rs.getString("last_name"));
    contact.setBirthDate(rs.getDate("birth_date"));

    return contact;
}

From source file:dao.DatasetCommentRowMapper.java

@Override
public DatasetComment mapRow(ResultSet rs, int rowNum) throws SQLException {

    int id = rs.getInt(ID_COLUMN);
    int datasetId = rs.getInt(DATASET_ID_COLUMN);
    String text = rs.getString(TEXT_COLUMN);
    String created = rs.getString(CREATED_TIME_COLUMN);
    String modified = rs.getString(MODIFIED_TIME_COLUMN);
    String type = rs.getString(COMMENT_TYPE_COLUMN);
    if (StringUtils.isBlank(type)) {
        type = DEFAULT_COMMENT_TYPE;/*from w  ww .j  a v a  2 s  . c  om*/
    }
    String authorName = rs.getString(USER_FULL_NAME_COLUMN);
    String authorEmail = rs.getString(USER_EMAIL_COLUMN);
    String userName = rs.getString(USER_NAME_COLUMN);
    DatasetComment datasetComment = new DatasetComment();
    datasetComment.id = id;
    datasetComment.datasetId = datasetId;
    datasetComment.text = text;
    datasetComment.created = created;
    datasetComment.modified = modified;
    datasetComment.type = type;
    datasetComment.authorName = authorName;
    datasetComment.authorEmail = authorEmail;
    datasetComment.authorUserName = userName;

    return datasetComment;
}

From source file:com.beezas.dao.UserExtractor.java

public User extractData(ResultSet resultSet) throws SQLException, DataAccessException {
    User user = new User();
    user.setCategoryId(resultSet.getInt(1));
    user.setCategoryName(resultSet.getString(2));
    return user;/* w  w  w  . jav  a 2  s  . com*/

}

From source file:com.ccoe.build.dal.PluginMapper.java

public Plugin mapRow(ResultSet rs, int arg1) throws SQLException {
    Plugin plugin = new Plugin();

    plugin.setId(rs.getInt("id"));
    plugin.setGroupId(rs.getString("group_id"));
    plugin.setArtifactId(rs.getString("artifact_id"));
    plugin.setVersion(rs.getString("version"));
    plugin.setPluginKey(rs.getString("plugin_key"));
    plugin.setPhaseName(rs.getString("phase"));

    return plugin;
}

From source file:com.example.library.MovieMapper.java

@Override
public Movie mapRow(ResultSet rs, int rowNum) throws SQLException {

    return new Movie(rs.getLong("id"), rs.getString("title"), null, rs.getInt("numSells"),
            rs.getInt("publishedDate"), null);
}

From source file:com.simpletasks.dao.impl.jdbc.TaskMapper.java

public Task mapRow(ResultSet resultSet, int i) throws SQLException {
    Task task = new Task();
    task.setId(resultSet.getInt(1));
    task.setTitle(resultSet.getString(3));
    task.setDetail(resultSet.getString(4));
    task.setFinished(resultSet.getBoolean(5));
    task.setCreateDate(DaoUtil.getDate(resultSet.getTimestamp(6)));
    task.setEndDate(DaoUtil.getDate(resultSet.getTimestamp(7)));
    return task;/* ww  w.  j  a  v  a  2 s  .  c o  m*/
}