- java.lang.Object
-
- org.sqlite.core.CoreStatement
-
- All Implemented Interfaces:
Codes
- Direct Known Subclasses:
JDBC3Statement
public abstract class CoreStatement extends Object implements Codes
-
-
Field Summary
Fields Modifier and Type Field Description protected Object[]
batch
protected int
batchPos
SQLiteConnection
conn
long
pointer
protected boolean
resultsWaiting
protected CoreResultSet
rs
protected String
sql
-
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
CoreStatement(SQLiteConnection c)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkOpen()
protected boolean
exec()
Calls sqlite3_step() and sets up results.protected boolean
exec(String sql)
Executes SQL statement and throws SQLExceptions if the given SQL statement is null or no database is open.abstract ResultSet
executeQuery(String sql, boolean closeStmt)
SQLiteConnectionConfig
getConnectionConfig()
DB
getDatbase()
protected void
internalClose()
-
-
-
Field Detail
-
conn
public final SQLiteConnection conn
-
rs
protected final CoreResultSet rs
-
pointer
public long pointer
-
sql
protected String sql
-
batchPos
protected int batchPos
-
batch
protected Object[] batch
-
resultsWaiting
protected boolean resultsWaiting
-
-
Constructor Detail
-
CoreStatement
protected CoreStatement(SQLiteConnection c)
-
-
Method Detail
-
getDatbase
public DB getDatbase()
-
getConnectionConfig
public SQLiteConnectionConfig getConnectionConfig()
-
checkOpen
protected final void checkOpen() throws SQLException
- Throws:
SQLException
- If the database is not opened.
-
exec
protected boolean exec() throws SQLException
Calls sqlite3_step() and sets up results. Expects a clean stmt.- Returns:
- True if the ResultSet has at least one row; false otherwise.
- Throws:
SQLException
- If the given SQL statement is null or no database is open.
-
exec
protected boolean exec(String sql) throws SQLException
Executes SQL statement and throws SQLExceptions if the given SQL statement is null or no database is open.- Parameters:
sql
- SQL statement.- Returns:
- True if the ResultSet has at least one row; false otherwise.
- Throws:
SQLException
- If the given SQL statement is null or no database is open.
-
internalClose
protected void internalClose() throws SQLException
- Throws:
SQLException
-
executeQuery
public abstract ResultSet executeQuery(String sql, boolean closeStmt) throws SQLException
- Throws:
SQLException
-
-