public final class ColumnNameResultSetReader extends java.lang.Object implements ResultReader<java.sql.ResultSet,java.lang.String>
ResultReader
for JDBC that uses the column name.Constructor and Description |
---|
ColumnNameResultSetReader() |
Modifier and Type | Method and Description |
---|---|
<T> T |
convertRequired(java.lang.Object value,
java.lang.Class<T> type)
Convert the value to the given type.
|
<T> T |
getRequiredValue(java.sql.ResultSet resultSet,
java.lang.String name,
java.lang.Class<T> type)
Get a value from the given result set for the given name and type.
|
boolean |
next(java.sql.ResultSet resultSet)
Move the index to the next result if possible.
|
java.math.BigDecimal |
readBigDecimal(java.sql.ResultSet resultSet,
java.lang.String name)
Read a BigDecimal value for the given name.
|
boolean |
readBoolean(java.sql.ResultSet resultSet,
java.lang.String name)
Read a boolean value for the given name.
|
byte |
readByte(java.sql.ResultSet resultSet,
java.lang.String name)
Read a byte value for the given name.
|
byte[] |
readBytes(java.sql.ResultSet resultSet,
java.lang.String name)
Read a byte[] value for the given name.
|
char |
readChar(java.sql.ResultSet resultSet,
java.lang.String name)
Read a char value for the given name.
|
java.util.Date |
readDate(java.sql.ResultSet resultSet,
java.lang.String name)
Read a date value for the given name.
|
double |
readDouble(java.sql.ResultSet resultSet,
java.lang.String name)
Read a double value for the given name.
|
java.lang.Object |
readDynamic(java.sql.ResultSet resultSet,
java.lang.String index,
DataType dataType)
Read a value dynamically using the result set and the given name and data type.
|
float |
readFloat(java.sql.ResultSet resultSet,
java.lang.String name)
Read a float value for the given name.
|
int |
readInt(java.sql.ResultSet resultSet,
java.lang.String name)
Read a int value for the given name.
|
long |
readLong(java.sql.ResultSet resultSet,
java.lang.String name)
Read a long value for the given name.
|
short |
readShort(java.sql.ResultSet resultSet,
java.lang.String name)
Read a short value for the given name.
|
java.lang.String |
readString(java.sql.ResultSet resultSet,
java.lang.String name)
Read a string value for the given name.
|
java.util.Date |
readTimestamp(java.sql.ResultSet resultSet,
java.lang.String index)
Read a timestamp value for the given index.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertRequired
@Nullable public java.lang.Object readDynamic(@NonNull java.sql.ResultSet resultSet, @NonNull java.lang.String index, @NonNull DataType dataType)
ResultReader
readDynamic
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setindex
- The namedataType
- The data typepublic boolean next(java.sql.ResultSet resultSet)
ResultReader
next
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setpublic <T> T convertRequired(@NonNull java.lang.Object value, java.lang.Class<T> type)
ResultReader
convertRequired
in interface ResultReader<java.sql.ResultSet,java.lang.String>
T
- The generic typevalue
- The valuetype
- The typepublic java.util.Date readTimestamp(java.sql.ResultSet resultSet, java.lang.String index)
ResultReader
readTimestamp
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setindex
- The index (such as the column name)public long readLong(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readLong
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public char readChar(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readChar
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public java.util.Date readDate(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readDate
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)@Nullable public java.lang.String readString(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readString
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public int readInt(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readInt
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public boolean readBoolean(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readBoolean
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public float readFloat(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readFloat
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public byte readByte(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readByte
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public short readShort(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readShort
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public double readDouble(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readDouble
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public java.math.BigDecimal readBigDecimal(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readBigDecimal
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public byte[] readBytes(java.sql.ResultSet resultSet, java.lang.String name)
ResultReader
readBytes
in interface ResultReader<java.sql.ResultSet,java.lang.String>
resultSet
- The result setname
- The name (such as the column name)public <T> T getRequiredValue(java.sql.ResultSet resultSet, java.lang.String name, java.lang.Class<T> type) throws DataAccessException
ResultReader
getRequiredValue
in interface ResultReader<java.sql.ResultSet,java.lang.String>
T
- The generic typeresultSet
- The result setname
- The nametype
- The typeDataAccessException
- if the value cannot be read