Example usage for java.sql ResultSet getLong

List of usage examples for java.sql ResultSet getLong

Introduction

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

Prototype

long getLong(String columnLabel) throws SQLException;

Source Link

Document

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

Usage

From source file:org.osmsurround.ae.search.SearchResultRepository.java

@Override
protected SearchResult mapRow(ResultSet rs, int rowNum) throws SQLException {
    return new SearchResult(rs.getLong(1), GeoConverter.fromDb(rs.getLong(2)),
            GeoConverter.fromDb(rs.getLong(3)), rs.getString(4), rs.getString(5));
}

From source file:dao.DatasetColumnCommentRowMapper.java

@Override
public DatasetColumnComment mapRow(ResultSet rs, int rowNum) throws SQLException {
    Long id = rs.getLong(ID_COLUMN);
    String author = rs.getString(AUTHOR_COLUMN);
    String text = rs.getString(TEXT_COLUMN);
    String created = rs.getString(CREATED_TIME_COLUMN);
    String modified = rs.getString(MODIFIED_TIME_COLUMN);
    Long columnId = rs.getLong(FIELD_ID_COLUMN);
    String strIsDefault = rs.getString(IS_DEFAULT_COLUMN);
    boolean isDefault = false;
    if (StringUtils.isNotBlank(strIsDefault) && strIsDefault == "Y") {
        isDefault = true;//from w w  w  . ja  va  2  s  . co  m
    }
    DatasetColumnComment datasetColumnComment = new DatasetColumnComment();

    datasetColumnComment.id = id;
    datasetColumnComment.author = author;
    datasetColumnComment.text = text;
    datasetColumnComment.created = created;
    datasetColumnComment.modified = modified;
    datasetColumnComment.columnId = columnId;
    datasetColumnComment.isDefault = isDefault;

    return datasetColumnComment;
}

From source file:com.mvdb.etl.model.OrderRowMapper.java

public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
    Order order = new Order();
    order.setOrderId(rs.getLong("ORDER_ID"));
    order.setNote(rs.getString("NOTE"));
    order.setSaleCode(rs.getInt("SALE_CODE"));
    order.setCreateTime(new java.util.Date(rs.getDate("CREATE_TIME").getTime()));
    order.setUpdateTime(new java.util.Date(rs.getDate("UPDATE_TIME").getTime()));
    return order;
}

From source file:lcn.module.batch.web.guide.service.TradeRowMapper.java

public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
    Trade trade = new Trade(rs.getLong(ID_COLUMN));

    trade.setIsin(rs.getString(ISIN_COLUMN));
    trade.setQuantity(rs.getLong(QUANTITY_COLUMN));
    trade.setPrice(rs.getBigDecimal(PRICE_COLUMN));
    trade.setCustomer(rs.getString(CUSTOMER_COLUMN));
    trade.setVersion(rs.getInt(VERSION_COLUMN));

    return trade;
}

From source file:com.carfinance.module.vehicleservicemanage.domain.UserDriverRowMapper.java

public UserDriver mapRow(ResultSet rs, int arg1) throws SQLException {
    UserDriver userDriver = new UserDriver();

    userDriver.setUser_id(rs.getLong("user_id"));
    userDriver.setUser_name(rs.getString("user_name"));
    userDriver.setEmployee_id(rs.getString("employee_id"));
    userDriver.setStatus(rs.getInt("driver_status"));
    userDriver.setDriver_license_no(rs.getString("driver_license_no"));

    return userDriver;
}

From source file:uta.ak.usttmp.common.dao.mapper.TopicRowMapper.java

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

    Topic tp = new Topic();
    tp.setId(rs.getLong("mme_eid"));
    tp.setName(rs.getString("name"));
    tp.setRemark(rs.getString("remark"));
    tp.setSeq(rs.getInt("seq_no"));
    tp.setMiningTaskId(rs.getLong("miningtask_id"));

    String content = rs.getString("content");
    String[] wordProbs = content.split(",");
    for (String wpstr : wordProbs) {
        String[] wp = wpstr.split(":");
        tp.addWordProbability(wp[0], Double.parseDouble(wp[1]));
    }//from  w w  w.  j a  v a  2 s . c o m

    return tp;
}

From source file:com.emc.ecs.sync.service.SqliteDbService.java

@Override
protected Date getResultDate(ResultSet rs, String name) throws SQLException {
    return new Date(rs.getLong(name));
}

From source file:io.apiman.manager.api.jdbc.handlers.UsageHistogramHandler.java

/**
 * @see org.apache.commons.dbutils.ResultSetHandler#handle(java.sql.ResultSet)
 *///from  w  ww.  j a v  a 2 s .c o m
@Override
public UsageHistogramBean handle(ResultSet rs) throws SQLException {
    while (rs.next()) {
        long time = rs.getLong(1);
        long count = rs.getLong(2);
        UsageDataPoint dataPoint = index.get(time);
        if (dataPoint != null) {
            dataPoint.setCount(count);
        }
    }
    return histogram;
}

From source file:dk.netarkivet.common.utils.DBUtils.java

/** Get the automatically generated key that was created with the
 * just-executed statement.//from  www.  j a v a 2s  .co m
 *
 * @param s A statement created with Statement.RETURN_GENERATED_KEYS
 * @return The single generated key
 * @throws SQLException If a database access error occurs or
 * the PreparedStatement is closed, or the JDBC driver does not support
 * the setGeneratedKeys() method
 */
public static long getGeneratedID(PreparedStatement s) throws SQLException {
    ArgumentNotValid.checkNotNull(s, "PreparedStatement s");
    ResultSet res = s.getGeneratedKeys();
    if (!res.next()) {
        throw new IOFailure("No keys generated by " + s);
    }
    return res.getLong(1);
}

From source file:com.healthcit.analytics.dao.rowmapper.ReportTemplateRowMapper.java

@Override
public ReportTemplate mapRow(ResultSet resultSet, int rowNum) throws SQLException {
    ReportTemplate template = new ReportTemplate(resultSet.getLong(ID_COLUMN),
            resultSet.getString(TITLE_COLUMN), resultSet.getString(REPORT_COLUMN),
            resultSet.getTimestamp(TIMESTAMP_COLUMN), resultSet.getLong(OWNER_ID_COLUMN),
            resultSet.getBoolean(SHARED_COLUMN));
    try {/*from   www  . j a v a 2 s.  co m*/
        resultSet.findColumn(USERNAME_COLUMN);
        template.setOwnerName(resultSet.getString(USERNAME_COLUMN));
    } catch (SQLException ex) {

    }

    return template;
}