public interface FieldSet
ResultSet
in JDBC, clients will know the name or position
of strongly typed fields that they want to extract.Modifier and Type | Method and Description |
---|---|
int |
getFieldCount()
Return the number of fields in this '
FieldSet '. |
java.lang.String[] |
getNames()
Accessor for the names of the fields.
|
java.util.Properties |
getProperties()
Construct name-value pairs from the field names and string values.
|
java.lang.String[] |
getValues() |
boolean |
hasNames()
Check if there are names defined for the fields.
|
java.math.BigDecimal |
readBigDecimal(int index)
Read the
BigDecimal value at index 'index '. |
java.math.BigDecimal |
readBigDecimal(int index,
java.math.BigDecimal defaultValue)
Read the
BigDecimal value at index 'index ',
returning the supplied defaultValue if the trimmed string
value at index 'index ' is blank. |
java.math.BigDecimal |
readBigDecimal(java.lang.String name)
Read the
BigDecimal value from column with given 'name . |
java.math.BigDecimal |
readBigDecimal(java.lang.String name,
java.math.BigDecimal defaultValue)
Read the
BigDecimal value from column with given 'name ,
returning the supplied defaultValue if the trimmed string
value at index 'index ' is blank. |
boolean |
readBoolean(int index)
Read the '
boolean ' value at index 'index '. |
boolean |
readBoolean(int index,
java.lang.String trueValue)
Read the '
boolean ' value at index 'index '. |
boolean |
readBoolean(java.lang.String name)
Read the '
boolean ' value from column with given 'name '. |
boolean |
readBoolean(java.lang.String name,
java.lang.String trueValue)
Read the '
boolean ' value from column with given 'name '. |
byte |
readByte(int index)
Read the '
byte ' value at index 'index '. |
byte |
readByte(java.lang.String name)
Read the '
byte ' value from column with given 'name '. |
char |
readChar(int index)
Read the '
char ' value at index 'index '. |
char |
readChar(java.lang.String name)
Read the '
char ' value from column with given 'name '. |
java.util.Date |
readDate(int index)
Read the
java.util.Date value in default format at
designated column index . |
java.util.Date |
readDate(int index,
java.util.Date defaultValue)
Read the
java.util.Date value in default format at
designated column index . |
java.util.Date |
readDate(int index,
java.lang.String pattern)
Read the
java.util.Date value in default format at
designated column index . |
java.util.Date |
readDate(int index,
java.lang.String pattern,
java.util.Date defaultValue)
Read the
java.util.Date value in default format at
designated column index . |
java.util.Date |
readDate(java.lang.String name)
Read the
java.sql.Date value in given format from column
with given name . |
java.util.Date |
readDate(java.lang.String name,
java.util.Date defaultValue)
Read the
java.sql.Date value in given format from column
with given name . |
java.util.Date |
readDate(java.lang.String name,
java.lang.String pattern)
Read the
java.sql.Date value in given format from column
with given name . |
java.util.Date |
readDate(java.lang.String name,
java.lang.String pattern,
java.util.Date defaultValue)
Read the
java.sql.Date value in given format from column
with given name . |
double |
readDouble(int index)
Read the '
double ' value at index 'index '. |
double |
readDouble(java.lang.String name)
Read the '
double ' value from column with given 'name . |
float |
readFloat(int index)
Read the '
float ' value at index 'index '. |
float |
readFloat(java.lang.String name)
Read the '
float ' value from column with given 'name . |
int |
readInt(int index)
Read the '
int ' value at index 'index '. |
int |
readInt(int index,
int defaultValue)
Read the '
int ' value at index 'index ',
using the supplied defaultValue if the field value is
blank. |
int |
readInt(java.lang.String name)
Read the '
int ' value from column with given 'name '. |
int |
readInt(java.lang.String name,
int defaultValue)
Read the '
int ' value from column with given 'name ',
using the supplied defaultValue if the field value is
blank. |
long |
readLong(int index)
Read the '
long ' value at index 'index '. |
long |
readLong(int index,
long defaultValue)
Read the '
long ' value at index 'index ',
using the supplied defaultValue if the field value is
blank. |
long |
readLong(java.lang.String name)
Read the '
long ' value from column with given 'name '. |
long |
readLong(java.lang.String name,
long defaultValue)
Read the '
long ' value from column with given 'name ',
using the supplied defaultValue if the field value is
blank. |
java.lang.String |
readRawString(int index)
Read the
String value at index 'index ' including
trailing whitespace (don't trim). |
java.lang.String |
readRawString(java.lang.String name)
Read the
String value from column with given 'name '
including trailing whitespace (don't trim). |
short |
readShort(int index)
Read the '
short ' value at index 'index '. |
short |
readShort(java.lang.String name)
Read the '
short ' value from column with given 'name '. |
java.lang.String |
readString(int index)
Read the
String value at index 'index '. |
java.lang.String |
readString(java.lang.String name)
Read the
String value from column with given 'name '. |
java.lang.String[] getNames()
java.lang.IllegalStateException
- if the names are not definedboolean hasNames()
java.lang.String[] getValues()
FieldSet
' instance as
String values.java.lang.String readString(int index)
String
value at index 'index
'.index
- the field index.String
containing the value at the index.java.lang.IndexOutOfBoundsException
- if the index
is out of bounds.java.lang.String readString(java.lang.String name)
String
value from column with given 'name
'.name
- the field name
.String
containing the value from the specified name
.java.lang.String readRawString(int index)
String
value at index 'index
' including
trailing whitespace (don't trim).index
- the field index.String
containing the value from the specified index
.java.lang.IndexOutOfBoundsException
- if the index
is out of bounds.java.lang.String readRawString(java.lang.String name)
String
value from column with given 'name
'
including trailing whitespace (don't trim).name
- the field name
.String
containing the value from the specified name
.boolean readBoolean(int index)
boolean
' value at index 'index
'.index
- the field index.index
.java.lang.IndexOutOfBoundsException
- if the index
is out of bounds.boolean readBoolean(java.lang.String name)
boolean
' value from column with given 'name
'.name
- the field name
.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.boolean readBoolean(int index, java.lang.String trueValue)
boolean
' value at index 'index
'.index
- the field index.trueValue
- the value that signifies true
;
case-sensitive.index
.java.lang.IndexOutOfBoundsException
- if the index is out of bounds, or if
the supplied trueValue
is null
.boolean readBoolean(java.lang.String name, java.lang.String trueValue)
boolean
' value from column with given 'name
'.name
- the field name
.trueValue
- the value that signifies true
;
case-sensitive.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined, or if the supplied trueValue
is null
.char readChar(int index)
char
' value at index 'index
'.index
- the field index.index
.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.char readChar(java.lang.String name)
char
' value from column with given 'name
'.name
- the field name
.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.byte readByte(int index)
byte
' value at index 'index
'.index
- the field index.index
.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.byte readByte(java.lang.String name)
byte
' value from column with given 'name
'.name
- the field name
.name
.short readShort(int index)
short
' value at index 'index
'.index
- the field index
.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.short readShort(java.lang.String name)
short
' value from column with given 'name
'.name
- the field name
.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.int readInt(int index)
int
' value at index 'index
'.index
- the field index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.int readInt(java.lang.String name)
int
' value from column with given 'name
'.name
- the field name
.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.int readInt(int index, int defaultValue)
int
' value at index 'index
',
using the supplied defaultValue
if the field value is
blank.index
- the field index.defaultValue
- the value to use if the field value is blank.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.int readInt(java.lang.String name, int defaultValue)
int
' value from column with given 'name
',
using the supplied defaultValue
if the field value is
blank.name
- the field name
.defaultValue
- the value to use if the field value is blank.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.long readLong(int index)
long
' value at index 'index
'.index
- the field index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.long readLong(java.lang.String name)
long
' value from column with given 'name
'.name
- the field name
.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.long readLong(int index, long defaultValue)
long
' value at index 'index
',
using the supplied defaultValue
if the field value is
blank.index
- the field index.defaultValue
- the value to use if the field value is blank.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.long readLong(java.lang.String name, long defaultValue)
long
' value from column with given 'name
',
using the supplied defaultValue
if the field value is
blank.name
- the field name
.defaultValue
- the value to use if the field value is blank.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.float readFloat(int index)
float
' value at index 'index
'.index
- the field index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.float readFloat(java.lang.String name)
float
' value from column with given 'name
.name
- the field name
.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.double readDouble(int index)
double
' value at index 'index
'.index
- the field index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.double readDouble(java.lang.String name)
double
' value from column with given 'name
.name
- the field name
.name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.java.math.BigDecimal readBigDecimal(int index)
BigDecimal
value at index 'index
'.index
- the field index.BigDecimal
containing the value from the specified index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.java.math.BigDecimal readBigDecimal(java.lang.String name)
BigDecimal
value from column with given 'name
.name
- the field name
.BigDecimal
containing the value from the specified name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.java.math.BigDecimal readBigDecimal(int index, java.math.BigDecimal defaultValue)
BigDecimal
value at index 'index
',
returning the supplied defaultValue
if the trimmed string
value at index 'index
' is blank.index
- the field index.defaultValue
- the value to use if the field value is blank.BigDecimal
containing the value from the specified index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.java.math.BigDecimal readBigDecimal(java.lang.String name, java.math.BigDecimal defaultValue)
BigDecimal
value from column with given 'name
,
returning the supplied defaultValue
if the trimmed string
value at index 'index
' is blank.name
- the field name
.defaultValue
- the default value to use if the field is blankBigDecimal
containing the value from the specified name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.java.util.Date readDate(int index)
java.util.Date
value in default format at
designated column index
.index
- the field index.Date
containing the value from the specified index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.java.lang.IllegalArgumentException
- if the value is not parseablejava.lang.NullPointerException
- if the value is emptyjava.util.Date readDate(java.lang.String name)
java.sql.Date
value in given format from column
with given name
.name
- the field name
.Date
containing the value from the specified name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined or if the value is not parseablejava.lang.NullPointerException
- if the value is emptyjava.util.Date readDate(int index, java.util.Date defaultValue)
java.util.Date
value in default format at
designated column index
.index
- the field index.defaultValue
- the default value to use if the field is blankDate
containing the value from the specified index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.java.lang.IllegalArgumentException
- if the value is not parseablejava.lang.NullPointerException
- if the value is emptyjava.util.Date readDate(java.lang.String name, java.util.Date defaultValue)
java.sql.Date
value in given format from column
with given name
.name
- the field name
.defaultValue
- the default value to use if the field is blankDate
containing the value from the specified name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined.java.util.Date readDate(int index, java.lang.String pattern)
java.util.Date
value in default format at
designated column index
.index
- the field index.pattern
- the pattern describing the date and time formatDate
containing the value from the specified index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.java.lang.IllegalArgumentException
- if the date cannot be parsed.java.util.Date readDate(java.lang.String name, java.lang.String pattern)
java.sql.Date
value in given format from column
with given name
.name
- the field name
.pattern
- the pattern describing the date and time formatDate
containing the value from the specified name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined or if the specified field cannot be parsedjava.util.Date readDate(int index, java.lang.String pattern, java.util.Date defaultValue)
java.util.Date
value in default format at
designated column index
.index
- the field index.pattern
- the pattern describing the date and time formatdefaultValue
- the default value to use if the field is blankDate
containing the value from the specified index.java.lang.IndexOutOfBoundsException
- if the index is out of bounds.java.lang.IllegalArgumentException
- if the date cannot be parsed.java.util.Date readDate(java.lang.String name, java.lang.String pattern, java.util.Date defaultValue)
java.sql.Date
value in given format from column
with given name
.name
- the field name
.pattern
- the pattern describing the date and time formatdefaultValue
- the default value to use if the field is blankDate
containing the value from the specified name
.java.lang.IllegalArgumentException
- if a column with given name
is not
defined or if the specified field cannot be parsedint getFieldCount()
FieldSet
'.java.util.Properties getProperties()
java.lang.IllegalStateException
- if the field name meta data is not
available.