Package org.sqlite.core
Class CoreResultSet
- java.lang.Object
-
- org.sqlite.core.CoreResultSet
-
- All Implemented Interfaces:
Codes
- Direct Known Subclasses:
JDBC3ResultSet
public abstract class CoreResultSet extends java.lang.Object implements Codes
Implements a JDBC ResultSet.
-
-
Field Summary
Fields Modifier and Type Field Description boolean
closeStmt
java.lang.String[]
cols
java.lang.String[]
colsMeta
protected java.util.Map<java.lang.String,java.lang.Integer>
columnNameToIndex
protected int
lastCol
protected int
limitRows
int
maxRows
protected boolean[][]
meta
boolean
open
protected int
row
protected CoreStatement
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
CoreResultSet(CoreStatement stmt)
Default constructor for a given statement.
-
Method Summary
Modifier and Type Method Description protected int
addColumnIndexInCache(java.lang.String col, int index)
int
checkCol(int col)
Takes col in [1,x] form, returns in [0,x-1] formvoid
checkMeta()
protected void
checkOpen()
void
close()
protected java.lang.Integer
findColumnIndexInCache(java.lang.String col)
protected SQLiteConnectionConfig
getConnectionConfig()
protected DB
getDatabase()
boolean
isOpen()
Checks the status of the result set.protected int
markCol(int col)
Takes col in [1,x] form, marks it as last accessed and returns [0,x-1]
-
-
-
Field Detail
-
stmt
protected final CoreStatement stmt
-
open
public boolean open
-
maxRows
public int maxRows
-
cols
public java.lang.String[] cols
-
colsMeta
public java.lang.String[] colsMeta
-
meta
protected boolean[][] meta
-
limitRows
protected int limitRows
-
row
protected int row
-
lastCol
protected int lastCol
-
closeStmt
public boolean closeStmt
-
columnNameToIndex
protected java.util.Map<java.lang.String,java.lang.Integer> columnNameToIndex
-
-
Constructor Detail
-
CoreResultSet
protected CoreResultSet(CoreStatement stmt)
Default constructor for a given statement.- Parameters:
stmt
- The statement.
-
-
Method Detail
-
getDatabase
protected DB getDatabase()
-
getConnectionConfig
protected SQLiteConnectionConfig getConnectionConfig()
-
isOpen
public boolean isOpen()
Checks the status of the result set.- Returns:
- True if has results and can iterate them; false otherwise.
-
checkOpen
protected void checkOpen() throws java.sql.SQLException
- Throws:
java.sql.SQLException
- if ResultSet is not open.
-
checkCol
public int checkCol(int col) throws java.sql.SQLException
Takes col in [1,x] form, returns in [0,x-1] form- Parameters:
col
-- Returns:
- Throws:
java.sql.SQLException
-
markCol
protected int markCol(int col) throws java.sql.SQLException
Takes col in [1,x] form, marks it as last accessed and returns [0,x-1]- Parameters:
col
-- Returns:
- Throws:
java.sql.SQLException
-
checkMeta
public void checkMeta() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
close
public void close() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
findColumnIndexInCache
protected java.lang.Integer findColumnIndexInCache(java.lang.String col)
-
addColumnIndexInCache
protected int addColumnIndexInCache(java.lang.String col, int index)
-
-