Package org.sqlite.jdbc3
Class JDBC3ResultSet
- java.lang.Object
-
- org.sqlite.core.CoreResultSet
-
- org.sqlite.jdbc3.JDBC3ResultSet
-
- All Implemented Interfaces:
Codes
- Direct Known Subclasses:
JDBC4ResultSet
public abstract class JDBC3ResultSet extends CoreResultSet
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.regex.Pattern
COLUMN_PRECISION
Pattern used to extract the precision and scale from column meta returned by the JDBC driver.protected static java.util.regex.Pattern
COLUMN_TYPECAST
Pattern used to extract the column type name from a cast(col as type)protected static java.util.regex.Pattern
COLUMN_TYPENAME
Pattern used to extract the column type name from table column definition.-
Fields inherited from class org.sqlite.core.CoreResultSet
closeStmt, cols, colsMeta, columnNameToIndex, emptyResultSet, lastCol, limitRows, maxRows, meta, open, pastLastRow, row, stmt
-
Fields inherited from interface org.sqlite.core.Codes
SQLITE_ABORT, SQLITE_AUTH, SQLITE_BLOB, SQLITE_BUSY, SQLITE_CANTOPEN, SQLITE_CONSTRAINT, SQLITE_CORRUPT, SQLITE_DONE, SQLITE_EMPTY, SQLITE_ERROR, SQLITE_FLOAT, SQLITE_FULL, SQLITE_INTEGER, SQLITE_INTERNAL, SQLITE_INTERRUPT, SQLITE_IOERR, SQLITE_LOCKED, SQLITE_MISMATCH, SQLITE_MISUSE, SQLITE_NOLFS, SQLITE_NOMEM, SQLITE_NOTFOUND, SQLITE_NULL, SQLITE_OK, SQLITE_PERM, SQLITE_PROTOCOL, SQLITE_READONLY, SQLITE_ROW, SQLITE_SCHEMA, SQLITE_TEXT, SQLITE_TOOBIG
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JDBC3ResultSet(CoreStatement stmt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearWarnings()
int
findColumn(java.lang.String col)
returns col in [1,x] formjava.math.BigDecimal
getBigDecimal(int col)
java.math.BigDecimal
getBigDecimal(java.lang.String col)
java.io.InputStream
getBinaryStream(int col)
java.io.InputStream
getBinaryStream(java.lang.String col)
boolean
getBoolean(int col)
boolean
getBoolean(java.lang.String col)
byte
getByte(int col)
byte
getByte(java.lang.String col)
byte[]
getBytes(int col)
byte[]
getBytes(java.lang.String col)
java.lang.String
getCatalogName(int col)
java.io.Reader
getCharacterStream(int col)
java.io.Reader
getCharacterStream(java.lang.String col)
java.lang.String
getColumnClassName(int col)
int
getColumnCount()
private java.lang.String
getColumnDeclType(int col)
int
getColumnDisplaySize(int col)
java.lang.String
getColumnLabel(int col)
java.lang.String
getColumnName(int col)
int
getColumnType(int col)
java.lang.String
getColumnTypeName(int col)
int
getConcurrency()
java.lang.String
getCursorName()
java.sql.Date
getDate(int col)
java.sql.Date
getDate(int col, java.util.Calendar cal)
java.sql.Date
getDate(java.lang.String col)
java.sql.Date
getDate(java.lang.String col, java.util.Calendar cal)
double
getDouble(int col)
double
getDouble(java.lang.String col)
int
getFetchDirection()
int
getFetchSize()
float
getFloat(int col)
float
getFloat(java.lang.String col)
int
getInt(int col)
int
getInt(java.lang.String col)
long
getLong(int col)
long
getLong(java.lang.String col)
java.sql.ResultSetMetaData
getMetaData()
java.lang.Object
getObject(int col)
java.lang.Object
getObject(java.lang.String col)
int
getPrecision(int col)
int
getRow()
int
getScale(int col)
java.lang.String
getSchemaName(int col)
short
getShort(int col)
short
getShort(java.lang.String col)
java.sql.Statement
getStatement()
java.lang.String
getString(int col)
java.lang.String
getString(java.lang.String col)
java.lang.String
getTableName(int col)
java.sql.Time
getTime(int col)
java.sql.Time
getTime(int col, java.util.Calendar cal)
java.sql.Time
getTime(java.lang.String col)
java.sql.Time
getTime(java.lang.String col, java.util.Calendar cal)
java.sql.Timestamp
getTimestamp(int col)
java.sql.Timestamp
getTimestamp(int col, java.util.Calendar cal)
java.sql.Timestamp
getTimestamp(java.lang.String col)
java.sql.Timestamp
getTimestamp(java.lang.String c, java.util.Calendar ca)
int
getType()
java.sql.SQLWarning
getWarnings()
boolean
isAfterLast()
boolean
isAutoIncrement(int col)
boolean
isBeforeFirst()
boolean
isCaseSensitive(int col)
boolean
isCurrency(int col)
boolean
isDefinitelyWritable(int col)
boolean
isFirst()
boolean
isLast()
int
isNullable(int col)
boolean
isReadOnly(int col)
boolean
isSearchable(int col)
boolean
isSigned(int col)
boolean
isWritable(int col)
private java.util.Calendar
julianDateToCalendar(java.lang.Double jd)
Transforms a Julian Date to java.util.Calendar object.private java.util.Calendar
julianDateToCalendar(java.lang.Double jd, java.util.Calendar cal)
Transforms a Julian Date to java.util.Calendar object.boolean
next()
private void
requireCalendarNotNull(java.util.Calendar cal)
boolean
rowDeleted()
boolean
rowInserted()
boolean
rowUpdated()
private java.lang.String
safeGetColumnName(int col)
private java.lang.String
safeGetColumnTableName(int col)
private java.lang.String
safeGetColumnText(int col)
protected int
safeGetColumnType(int col)
private double
safeGetDoubleCol(int col)
private long
safeGetLongCol(int col)
void
setFetchDirection(int d)
void
setFetchSize(int rows)
boolean
wasNull()
-
Methods inherited from class org.sqlite.core.CoreResultSet
addColumnIndexInCache, checkCol, checkMeta, checkOpen, close, findColumnIndexInCache, getConnectionConfig, getDatabase, isOpen, markCol
-
-
-
-
Field Detail
-
COLUMN_TYPENAME
protected static final java.util.regex.Pattern COLUMN_TYPENAME
Pattern used to extract the column type name from table column definition.
-
COLUMN_TYPECAST
protected static final java.util.regex.Pattern COLUMN_TYPECAST
Pattern used to extract the column type name from a cast(col as type)
-
COLUMN_PRECISION
protected static final java.util.regex.Pattern COLUMN_PRECISION
Pattern used to extract the precision and scale from column meta returned by the JDBC driver.
-
-
Constructor Detail
-
JDBC3ResultSet
protected JDBC3ResultSet(CoreStatement stmt)
-
-
Method Detail
-
findColumn
public int findColumn(java.lang.String col) throws java.sql.SQLException
returns col in [1,x] form- Throws:
java.sql.SQLException
- See Also:
ResultSet.findColumn(java.lang.String)
-
next
public boolean next() throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.next()
-
getType
public int getType()
- See Also:
ResultSet.getType()
-
getFetchSize
public int getFetchSize()
- See Also:
ResultSet.getFetchSize()
-
setFetchSize
public void setFetchSize(int rows) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.setFetchSize(int)
-
getFetchDirection
public int getFetchDirection() throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getFetchDirection()
-
setFetchDirection
public void setFetchDirection(int d) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.setFetchDirection(int)
-
isAfterLast
public boolean isAfterLast()
- See Also:
ResultSet.isAfterLast()
-
isBeforeFirst
public boolean isBeforeFirst()
- See Also:
ResultSet.isBeforeFirst()
-
isFirst
public boolean isFirst()
- See Also:
ResultSet.isFirst()
-
isLast
public boolean isLast() throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.isLast()
-
getRow
public int getRow()
- See Also:
ResultSet.getRow()
-
wasNull
public boolean wasNull() throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.wasNull()
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getBigDecimal(int)
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getBigDecimal(java.lang.String)
-
getBoolean
public boolean getBoolean(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getBoolean(int)
-
getBoolean
public boolean getBoolean(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getBoolean(java.lang.String)
-
getBinaryStream
public java.io.InputStream getBinaryStream(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getBinaryStream(int)
-
getBinaryStream
public java.io.InputStream getBinaryStream(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getBinaryStream(java.lang.String)
-
getByte
public byte getByte(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getByte(int)
-
getByte
public byte getByte(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getByte(java.lang.String)
-
getBytes
public byte[] getBytes(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getBytes(int)
-
getBytes
public byte[] getBytes(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getBytes(java.lang.String)
-
getCharacterStream
public java.io.Reader getCharacterStream(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getCharacterStream(int)
-
getCharacterStream
public java.io.Reader getCharacterStream(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getCharacterStream(java.lang.String)
-
getDate
public java.sql.Date getDate(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getDate(int)
-
getDate
public java.sql.Date getDate(int col, java.util.Calendar cal) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getDate(int, java.util.Calendar)
-
getDate
public java.sql.Date getDate(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getDate(java.lang.String)
-
getDate
public java.sql.Date getDate(java.lang.String col, java.util.Calendar cal) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getDate(java.lang.String, java.util.Calendar)
-
getDouble
public double getDouble(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getDouble(int)
-
getDouble
public double getDouble(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getDouble(java.lang.String)
-
getFloat
public float getFloat(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getFloat(int)
-
getFloat
public float getFloat(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getFloat(java.lang.String)
-
getInt
public int getInt(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getInt(int)
-
getInt
public int getInt(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getInt(java.lang.String)
-
getLong
public long getLong(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getLong(int)
-
getLong
public long getLong(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getLong(java.lang.String)
-
getShort
public short getShort(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getShort(int)
-
getShort
public short getShort(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getShort(java.lang.String)
-
getString
public java.lang.String getString(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getString(int)
-
getString
public java.lang.String getString(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getString(java.lang.String)
-
getTime
public java.sql.Time getTime(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getTime(int)
-
getTime
public java.sql.Time getTime(int col, java.util.Calendar cal) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getTime(int, java.util.Calendar)
-
getTime
public java.sql.Time getTime(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getTime(java.lang.String)
-
getTime
public java.sql.Time getTime(java.lang.String col, java.util.Calendar cal) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getTime(java.lang.String, java.util.Calendar)
-
getTimestamp
public java.sql.Timestamp getTimestamp(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getTimestamp(int)
-
getTimestamp
public java.sql.Timestamp getTimestamp(int col, java.util.Calendar cal) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getTimestamp(int, java.util.Calendar)
-
getTimestamp
public java.sql.Timestamp getTimestamp(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getTimestamp(java.lang.String)
-
getTimestamp
public java.sql.Timestamp getTimestamp(java.lang.String c, java.util.Calendar ca) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getTimestamp(java.lang.String, java.util.Calendar)
-
getObject
public java.lang.Object getObject(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getObject(int)
-
getObject
public java.lang.Object getObject(java.lang.String col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSet.getObject(java.lang.String)
-
getStatement
public java.sql.Statement getStatement()
- See Also:
ResultSet.getStatement()
-
getCursorName
public java.lang.String getCursorName()
- See Also:
ResultSet.getCursorName()
-
getWarnings
public java.sql.SQLWarning getWarnings()
- See Also:
ResultSet.getWarnings()
-
clearWarnings
public void clearWarnings()
- See Also:
ResultSet.clearWarnings()
-
getMetaData
public java.sql.ResultSetMetaData getMetaData()
- See Also:
ResultSet.getMetaData()
-
getCatalogName
public java.lang.String getCatalogName(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getCatalogName(int)
-
getColumnClassName
public java.lang.String getColumnClassName(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getColumnClassName(int)
-
getColumnCount
public int getColumnCount() throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getColumnCount()
-
getColumnDisplaySize
public int getColumnDisplaySize(int col)
- See Also:
ResultSetMetaData.getColumnDisplaySize(int)
-
getColumnLabel
public java.lang.String getColumnLabel(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getColumnLabel(int)
-
getColumnName
public java.lang.String getColumnName(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getColumnName(int)
-
getColumnType
public int getColumnType(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getColumnType(int)
-
getColumnTypeName
public java.lang.String getColumnTypeName(int col) throws java.sql.SQLException
- Returns:
- The data type from either the 'create table' statement, or CAST(expr AS TYPE) otherwise sqlite3_value_type.
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getColumnTypeName(int)
-
getPrecision
public int getPrecision(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getPrecision(int)
-
getColumnDeclType
private java.lang.String getColumnDeclType(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getScale
public int getScale(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getScale(int)
-
getSchemaName
public java.lang.String getSchemaName(int col)
- See Also:
ResultSetMetaData.getSchemaName(int)
-
getTableName
public java.lang.String getTableName(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.getTableName(int)
-
isNullable
public int isNullable(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.isNullable(int)
-
isAutoIncrement
public boolean isAutoIncrement(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.isAutoIncrement(int)
-
isCaseSensitive
public boolean isCaseSensitive(int col)
- See Also:
ResultSetMetaData.isCaseSensitive(int)
-
isCurrency
public boolean isCurrency(int col)
- See Also:
ResultSetMetaData.isCurrency(int)
-
isDefinitelyWritable
public boolean isDefinitelyWritable(int col)
- See Also:
ResultSetMetaData.isDefinitelyWritable(int)
-
isReadOnly
public boolean isReadOnly(int col)
- See Also:
ResultSetMetaData.isReadOnly(int)
-
isSearchable
public boolean isSearchable(int col)
- See Also:
ResultSetMetaData.isSearchable(int)
-
isSigned
public boolean isSigned(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
- See Also:
ResultSetMetaData.isSigned(int)
-
isWritable
public boolean isWritable(int col)
- See Also:
ResultSetMetaData.isWritable(int)
-
getConcurrency
public int getConcurrency()
- See Also:
ResultSet.getConcurrency()
-
rowDeleted
public boolean rowDeleted()
- See Also:
ResultSet.rowDeleted()
-
rowInserted
public boolean rowInserted()
- See Also:
ResultSet.rowInserted()
-
rowUpdated
public boolean rowUpdated()
- See Also:
ResultSet.rowUpdated()
-
julianDateToCalendar
private java.util.Calendar julianDateToCalendar(java.lang.Double jd)
Transforms a Julian Date to java.util.Calendar object.
-
julianDateToCalendar
private java.util.Calendar julianDateToCalendar(java.lang.Double jd, java.util.Calendar cal)
Transforms a Julian Date to java.util.Calendar object. Based on Guine Christian's function found here: http://java.ittoolbox.com/groups/technical-functional/java-l/java-function-to-convert-julian-date-to-calendar-date-1947446
-
requireCalendarNotNull
private void requireCalendarNotNull(java.util.Calendar cal) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
safeGetColumnType
protected int safeGetColumnType(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
safeGetLongCol
private long safeGetLongCol(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
safeGetDoubleCol
private double safeGetDoubleCol(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
safeGetColumnText
private java.lang.String safeGetColumnText(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
safeGetColumnTableName
private java.lang.String safeGetColumnTableName(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
safeGetColumnName
private java.lang.String safeGetColumnName(int col) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-