This section lists the ResultSet.getXXX methods recommended and allowed for retrieving data of each JDBC type.
TINYINT: getByte (recommended)
Can also be read using getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getString, getObject
SMALLINT: getShort (recommended)
Can also be read using getByte, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getString, getObject
INTEGER: getInt (recommended)
Can also be read using getByte, getShort, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getString, getObject
BIGINT: getLong (recommended)
Can also be read using getByte, getShort, getInt, getFloat, getDouble, getBigDecimal, getBoolean, getString, getObject
REAL: getFloat (recommended)
Can also be read using getByte, getShort, getInt, getLong, getDouble, getBigDecimal, getBoolean, getString, getObject
FLOAT: getDouble (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getBigDecimal, getBoolean, getString, getObject
DOUBLE: getDouble (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getBigDecimal, getBoolean, getString, getObject
DECIMAL: getBigDecimal (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBoolean, getString, getObject
NUMERIC: getBigDecimal (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBoolean, getString, getObject
BIT: getBoolean (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getString, getObject
CHAR: getString (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getDate, getTime, getTimestamp, getAsciiStream, getUnicodeStream, getObject
VARCHAR: getString (recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getDate, getTime, getTimestamp, getAsciiStream, getUnicodeStream, getObject
LONGVARCHAR: getAsciiStream, getUnicodeStream (both recommended)
Can also be read using getByte, getShort, getInt, getLong, getFloat, getDouble, getBigDecimal, getBoolean, getString, getDate, getTime, getTimestamp, getObject
BINARY: getBytes (recommended)
Can also be read using getString, getAsciiStream, getUnicodeStream, getBinaryStream, getObject
VARBINARY: getBytes (recommended)
Can also be read using getString, getAsciiStream, getUnicodeStream, getBinaryStream, getObject
LONGVARBINARY: getBinaryStream (recommended)
Can also be read using getString, getBytes, getAsciiStream, getUnicodeStream, getObject
DATE: getDate (recommended)
Can also be read using getString, getTimestamp, getObject
TIME: getTime (recommended)
Can also be read using getString, getTimestamp, getObject
TIMESTAMP: getTimestamp (recommended)
Can also be read using getString, getDate, getTime, getObject
This section lists the JDBC types that each ResultSet.getXXX method supports.
getByte: TINYINT (recommended)
Can also read SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getShort: SMALLINT (recommended)
Can also read TINYINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getInt: INTEGER (recommended)
Can also read TINYINT, SMALLINT, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getLong: BIGINT (recommended)
Can also read TINYINT, SMALLINT, INTEGER, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getFloat: REAL (recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getDouble: FLOAT, DOUBLE (both recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR
getBigDecimal: DECIMAL, NUMERIC (both recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, BIT, CHAR, VARCHAR, LONGVARCHAR
getBoolean: BIT (recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, VARCHAR, LONGVARCHAR
getString: CHAR, VARCHAR (both recommended)
Can also read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, LONGVARCHAR, BINARY, VARBINARY, LONGVARBINARY, DATE, TIME, TIMESTAMP
getBytes: BINARY, VARBINARY (both recommended)
Can also read LONGVARBINARY
getDate: DATE (recommended)
Can also read CHAR, VARCHAR, LONGVARCHAR, TIMESTAMP
getTime: TIME (recommended)
Can also read CHAR, VARCHAR, LONGVARCHAR, TIMESTAMP
getTimestamp: TIMESTAMP (recommended)
Can also read CHAR, VARCHAR, LONGVARCHAR, DATE, TIME
getAsciiStream: LONGVARCHAR (recommended)
Can also read CHAR, VARCHAR, BINARY, VARBINARY, LONGVARBINARY
getUnicodeStream: LONGVARCHAR (recommended)
Can also read CHAR, VARCHAR, BINARY, VARBINARY, LONGVARBINARY
getBinaryStream: LONGVARBINARY (recommended)
Can also read BINARY, VARBINARY
getObject: (no recommended type)
Can read TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR, LONGVARCHAR, BINARY, VARBINARY, LONGVARBINARY, DATE, TIME, TIMESTAMP
Mapping of JDBC Types to Java Types
JDBC Type
Java Type
CHAR |
String |
VARCHAR |
String |
LONGVARCHAR |
String |
NUMERIC |
java.math.BigDecimal |
DECIMAL |
java.math.BigDecimal |
BIT |
boolean |
BOOLEAN |
boolean |
TINYINT |
byte |
SMALLINT |
short |
INTEGER |
int |
BIGINT |
long |
REAL |
float |
FLOAT |
double |
DOUBLE |
double |
BINARY |
byte[] |
VARBINARY |
byte[] |
LONGVARBINARY |
byte[] |
DATE |
java.sql.Date |
TIME |
java.sql.Time |
TIMESTAMP |
java.sql.Timestamp |
CLOB |
Clob |
BLOB |
Blob |
ARRAY |
Array |
DISTINCT |
mapping of underlying type |
STRUCT |
Struct |
REF |
Ref |
DATALINK |
java.net.URL |
JAVA_OBJECT |
underlying Java class |