Example usage for org.springframework.jdbc.support JdbcUtils getResultSetValue

List of usage examples for org.springframework.jdbc.support JdbcUtils getResultSetValue

Introduction

In this page you can find the example usage for org.springframework.jdbc.support JdbcUtils getResultSetValue.

Prototype

@Nullable
public static Object getResultSetValue(ResultSet rs, int index, @Nullable Class<?> requiredType)
        throws SQLException 

Source Link

Document

Retrieve a JDBC column value from a ResultSet, using the specified value type.

Usage

From source file:org.springframework.jdbc.core.BeanPropertyRowMapper.java

/**
 * Retrieve a JDBC object value for the specified column.
 * <p>The default implementation calls
 * {@link JdbcUtils#getResultSetValue(java.sql.ResultSet, int, Class)}.
 * Subclasses may override this to check specific value types upfront,
 * or to post-process values return from {@code getResultSetValue}.
 * @param rs is the ResultSet holding the data
 * @param index is the column index//from   w w  w .  j  a  v a 2  s .c  o  m
 * @param pd the bean property that each result object is expected to match
 * @return the Object value
 * @throws SQLException in case of extraction failure
 * @see org.springframework.jdbc.support.JdbcUtils#getResultSetValue(java.sql.ResultSet, int, Class)
 */
@Nullable
protected Object getColumnValue(ResultSet rs, int index, PropertyDescriptor pd) throws SQLException {
    return JdbcUtils.getResultSetValue(rs, index, pd.getPropertyType());
}