Modifier and Type | Class and Description |
---|---|
static interface |
DB.ProgressObserver |
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 and Description |
---|
DB(String url,
String fileName,
SQLiteConfig config) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
_close()
Closes the SQLite interface to a database.
|
abstract int |
_exec(String sql)
Complies, evaluates, executes and commits an SQL statement.
|
protected abstract void |
_open(String filename,
int openFlags)
Creates an SQLite interface to a database with the provided open flags.
|
void |
addCommitListener(SQLiteCommitListener listener) |
void |
addUpdateListener(SQLiteUpdateListener listener) |
abstract int |
backup(String dbName,
String destFileName,
DB.ProgressObserver observer) |
abstract void |
busy_handler(BusyHandler busyHandler)
Sets a busy handler that sleeps
for a specified amount of time when a table is locked.
|
abstract void |
busy_timeout(int ms)
Sets a busy handler that sleeps
for a specified amount of time when a table is locked.
|
abstract int |
changes() |
abstract int |
clear_bindings(long stmt)
Reset all bindings on a prepared statement (reset all host parameters to NULL).
|
abstract void |
clear_progress_handler() |
void |
close()
Closes a database connection and finalizes any remaining statements before
the closing operation.
|
abstract byte[] |
column_blob(long stmt,
int col) |
abstract int |
column_count(long stmt) |
abstract String |
column_decltype(long stmt,
int col) |
abstract double |
column_double(long stmt,
int col) |
abstract int |
column_int(long stmt,
int col) |
abstract long |
column_long(long stmt,
int col) |
abstract String |
column_name(long stmt,
int col) |
String[] |
column_names(long stmt)
Returns an array of column names in the result set of the SELECT statement.
|
abstract String |
column_table_name(long stmt,
int col) |
abstract String |
column_text(long stmt,
int col) |
abstract int |
column_type(long stmt,
int col) |
abstract int |
create_function(String name,
Function f,
int nArgs,
int flags)
Create a user defined function with given function name and the function object.
|
abstract int |
destroy_function(String name,
int nArgs)
De-registers a user defined function
|
abstract int |
enable_load_extension(boolean enable)
Enables or disables loading of SQLite extensions.
|
void |
exec(String sql,
boolean autoCommit)
Executes an SQL statement using the process of compiling, evaluating, and destroying the
prepared statement object.
|
boolean |
execute(CoreStatement stmt,
Object[] vals) |
int |
executeUpdate(CoreStatement stmt,
Object[] vals)
Execute an SQL INSERT, UPDATE or DELETE statement with the Stmt object and an array of
parameter values of the SQL statement..
|
int |
finalize(CoreStatement stmt)
Destroys a statement.
|
protected abstract int |
finalize(long stmt)
Destroys a prepared statement.
|
SQLiteConfig |
getConfig() |
String |
getUrl() |
abstract void |
interrupt()
Aborts any pending operation and returns at its earliest opportunity.
|
boolean |
isClosed() |
abstract String |
libversion()
Returns the value for SQLITE_VERSION, SQLITE_VERSION_NUMBER, and SQLITE_SOURCE_ID C
preprocessor macros that are associated with the library.
|
abstract int |
limit(int id,
int value) |
static SQLiteException |
newSQLException(int errorCode,
String errorMessage)
Throws formated SQLException with error code and message.
|
void |
open(String file,
int openFlags)
Creates an SQLite interface to a database for the given connection.
|
void |
prepare(CoreStatement stmt)
Complies the an SQL statement.
|
protected abstract long |
prepare(String sql)
Complies an SQL statement.
|
abstract void |
register_progress_handler(int vmCalls,
ProgressHandler progressHandler)
Progress handler
|
void |
removeCommitListener(SQLiteCommitListener listener) |
void |
removeUpdateListener(SQLiteUpdateListener listener) |
abstract int |
reset(long stmt)
Sets a prepared statement object back to its initial state,
ready to be re-executed.
|
abstract int |
restore(String dbName,
String sourceFileName,
DB.ProgressObserver observer) |
abstract void |
result_blob(long context,
byte[] val)
Sets the result of an SQL function as blob data type with the pointer to the SQLite database
context and the the result value of byte array.
|
abstract void |
result_double(long context,
double val)
Sets the result of an SQL function as double data type with the pointer to the SQLite
database context and the the result value of double.
|
abstract void |
result_error(long context,
String err)
Sets the result of an SQL function as an error with the pointer to the SQLite database
context and the the error of String.
|
abstract void |
result_int(long context,
int val)
Sets the result of an SQL function as int data type with the pointer to the SQLite database
context and the the result value of int.
|
abstract void |
result_long(long context,
long val)
Sets the result of an SQL function as long data type with the pointer to the SQLite database
context and the the result value of long.
|
abstract void |
result_null(long context)
Sets the result of an SQL function as NULL with the pointer to the SQLite database context.
|
abstract void |
result_text(long context,
String val)
Sets the result of an SQL function as text data type with the pointer to the SQLite database
context and the the result value of String.
|
abstract int |
shared_cache(boolean enable)
Enables or disables the sharing of the database cache and schema data structures between
connections to the same database.
|
abstract int |
step(long stmt)
Evaluates a statement.
|
void |
throwex(int errorCode)
Throws SQLException with error code.
|
abstract int |
total_changes() |
abstract byte[] |
value_blob(Function f,
int arg) |
abstract double |
value_double(Function f,
int arg) |
abstract int |
value_int(Function f,
int arg)
Accesses the parameter values on the function or aggregate in int data type with the function
object and the parameter value.
|
abstract long |
value_long(Function f,
int arg) |
abstract String |
value_text(Function f,
int arg) |
abstract int |
value_type(Function f,
int arg) |
public DB(String url, String fileName, SQLiteConfig config) throws SQLException
SQLException
public String getUrl()
public boolean isClosed()
public SQLiteConfig getConfig()
public abstract void interrupt() throws SQLException
SQLException
public abstract void busy_timeout(int ms) throws SQLException
ms
- Time to sleep in milliseconds.SQLException
public abstract void busy_handler(BusyHandler busyHandler) throws SQLException
busyHandler
- SQLException
public abstract String libversion() throws SQLException
SQLException
public abstract int changes() throws SQLException
SQLException
public abstract int total_changes() throws SQLException
SQLException
public abstract int shared_cache(boolean enable) throws SQLException
enable
- True to enable; false otherwise.SQLException
SQLiteErrorCode
public abstract int enable_load_extension(boolean enable) throws SQLException
enable
- True to enable; false otherwise.SQLException
public final void exec(String sql, boolean autoCommit) throws SQLException
sql
- SQL statement to be executed.SQLException
public final void open(String file, int openFlags) throws SQLException
file
- The database.openFlags
- File opening configurations
(http://www.sqlite.org/c3ref/c_open_autoproxy.html)SQLException
public final void close() throws SQLException
SQLException
public final void prepare(CoreStatement stmt) throws SQLException
stmt
- The SQL statement to compile.SQLException
public final int finalize(CoreStatement stmt) throws SQLException
stmt
- The statement to destroy.SQLException
protected abstract void _open(String filename, int openFlags) throws SQLException
filename
- The database to open.openFlags
- File opening configurations
(http://www.sqlite.org/c3ref/c_open_autoproxy.html)SQLException
protected abstract void _close() throws SQLException
SQLException
public abstract int _exec(String sql) throws SQLException
sql
- An SQL statement.SQLException
protected abstract long prepare(String sql) throws SQLException
sql
- An SQL statement.SQLException
protected abstract int finalize(long stmt) throws SQLException
stmt
- Pointer to the statement pointer.SQLException
public abstract int step(long stmt) throws SQLException
stmt
- Pointer to the statement.SQLException
public abstract int reset(long stmt) throws SQLException
stmt
- Pointer to the statement.SQLException
public abstract int clear_bindings(long stmt) throws SQLException
stmt
- Pointer to the statement.SQLException
public abstract int column_count(long stmt) throws SQLException
stmt
- Pointer to the statement.SQLException
public abstract int column_type(long stmt, int col) throws SQLException
stmt
- Pointer to the statement.col
- Number of column.SQLException
public abstract String column_decltype(long stmt, int col) throws SQLException
stmt
- Pointer to the statement.col
- Number of column.SQLException
public abstract String column_table_name(long stmt, int col) throws SQLException
stmt
- Pointer to the statement.col
- Number of column.SQLException
public abstract String column_name(long stmt, int col) throws SQLException
stmt
- Pointer to the statement.col
- The number of column.SQLException
public abstract String column_text(long stmt, int col) throws SQLException
stmt
- Pointer to the statement.col
- Number of column.SQLException
public abstract byte[] column_blob(long stmt, int col) throws SQLException
stmt
- Pointer to the statement.col
- Number of column.SQLException
public abstract double column_double(long stmt, int col) throws SQLException
stmt
- Pointer to the statement.col
- Number of column.SQLException
public abstract long column_long(long stmt, int col) throws SQLException
stmt
- Pointer to the statement.col
- Number of column.SQLException
public abstract int column_int(long stmt, int col) throws SQLException
stmt
- Pointer to the statement.col
- Number of column.SQLException
public abstract void result_null(long context) throws SQLException
context
- Pointer to the SQLite database context.SQLException
public abstract void result_text(long context, String val) throws SQLException
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.SQLException
public abstract void result_blob(long context, byte[] val) throws SQLException
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.SQLException
public abstract void result_double(long context, double val) throws SQLException
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.SQLException
public abstract void result_long(long context, long val) throws SQLException
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.SQLException
public abstract void result_int(long context, int val) throws SQLException
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.SQLException
public abstract void result_error(long context, String err) throws SQLException
context
- Pointer to the SQLite database context.err
- Error result of an SQL function.SQLException
public abstract String value_text(Function f, int arg) throws SQLException
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.SQLException
public abstract byte[] value_blob(Function f, int arg) throws SQLException
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.SQLException
public abstract double value_double(Function f, int arg) throws SQLException
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.SQLException
public abstract long value_long(Function f, int arg) throws SQLException
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.SQLException
public abstract int value_int(Function f, int arg) throws SQLException
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.SQLException
public abstract int value_type(Function f, int arg) throws SQLException
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.SQLException
public abstract int create_function(String name, Function f, int nArgs, int flags) throws SQLException
name
- The function name to be created.f
- SQLite function object.flags
- Extra flags to use when creating the function, such as Function.FLAG_DETERMINISTIC
SQLException
public abstract int destroy_function(String name, int nArgs) throws SQLException
name
- Name of the function to de-registered.SQLException
public abstract int backup(String dbName, String destFileName, DB.ProgressObserver observer) throws SQLException
dbName
- Database name to be backed up.destFileName
- Target backup file name.observer
- ProgressObserver object.SQLException
public abstract int restore(String dbName, String sourceFileName, DB.ProgressObserver observer) throws SQLException
dbName
- Database name for restoring data.sourceFileName
- Source file name.observer
- ProgressObserver object.SQLException
public abstract int limit(int id, int value) throws SQLException
id
- The id of the limit.value
- The new value of the limit.SQLException
public abstract void register_progress_handler(int vmCalls, ProgressHandler progressHandler) throws SQLException
SQLException
public abstract void clear_progress_handler() throws SQLException
SQLException
public final String[] column_names(long stmt) throws SQLException
stmt
- Stmt object.SQLException
public final boolean execute(CoreStatement stmt, Object[] vals) throws SQLException
stmt
- Stmt object.vals
- Array of parameter values.SQLException
public final int executeUpdate(CoreStatement stmt, Object[] vals) throws SQLException
stmt
- Stmt object.vals
- Array of parameter values.SQLException
public void addUpdateListener(SQLiteUpdateListener listener)
public void addCommitListener(SQLiteCommitListener listener)
public void removeUpdateListener(SQLiteUpdateListener listener)
public void removeCommitListener(SQLiteCommitListener listener)
public final void throwex(int errorCode) throws SQLException
errorCode
- Error code to be passed.SQLException
public static SQLiteException newSQLException(int errorCode, String errorMessage)
errorCode
- Error code to be passed.errorMessage
- Error message to be passed.SQLException
Copyright © 2021. All rights reserved.