| 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.
|
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 flags)
Create a user defined function with given function name and the function object.
|
abstract int |
destroy_function(String name)
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.
|
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
|
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
SQLExceptionpublic String getUrl()
public boolean isClosed()
public SQLiteConfig getConfig()
public abstract void interrupt()
throws SQLException
SQLExceptionpublic abstract void busy_timeout(int ms)
throws SQLException
ms - Time to sleep in milliseconds.SQLExceptionpublic abstract void busy_handler(BusyHandler busyHandler) throws SQLException
busyHandler - SQLExceptionpublic abstract String libversion() throws SQLException
SQLExceptionpublic abstract int changes()
throws SQLException
SQLExceptionpublic abstract int total_changes()
throws SQLException
SQLExceptionpublic abstract int shared_cache(boolean enable)
throws SQLException
enable - True to enable; false otherwise.SQLExceptionSQLiteErrorCodepublic abstract int enable_load_extension(boolean enable)
throws SQLException
enable - True to enable; false otherwise.SQLExceptionpublic final void exec(String sql, boolean autoCommit) throws SQLException
sql - SQL statement to be executed.SQLExceptionpublic 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)SQLExceptionpublic final void close()
throws SQLException
SQLExceptionpublic final void prepare(CoreStatement stmt) throws SQLException
stmt - The SQL statement to compile.SQLExceptionpublic final int finalize(CoreStatement stmt) throws SQLException
stmt - The statement to destroy.SQLExceptionprotected 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)SQLExceptionprotected abstract void _close()
throws SQLException
SQLExceptionpublic abstract int _exec(String sql) throws SQLException
sql - An SQL statement.SQLExceptionprotected abstract long prepare(String sql) throws SQLException
sql - An SQL statement.SQLExceptionprotected abstract int finalize(long stmt)
throws SQLException
stmt - Pointer to the statement pointer.SQLExceptionpublic abstract int step(long stmt)
throws SQLException
stmt - Pointer to the statement.SQLExceptionpublic abstract int reset(long stmt)
throws SQLException
stmt - Pointer to the statement.SQLExceptionpublic abstract int clear_bindings(long stmt)
throws SQLException
stmt - Pointer to the statement.SQLExceptionpublic abstract int column_count(long stmt)
throws SQLException
stmt - Pointer to the statement.SQLExceptionpublic abstract int column_type(long stmt,
int col)
throws SQLException
stmt - Pointer to the statement.col - Number of column.SQLExceptionpublic abstract String column_decltype(long stmt, int col) throws SQLException
stmt - Pointer to the statement.col - Number of column.SQLExceptionpublic abstract String column_table_name(long stmt, int col) throws SQLException
stmt - Pointer to the statement.col - Number of column.SQLExceptionpublic abstract String column_name(long stmt, int col) throws SQLException
stmt - Pointer to the statement.col - The number of column.SQLExceptionpublic abstract String column_text(long stmt, int col) throws SQLException
stmt - Pointer to the statement.col - Number of column.SQLExceptionpublic abstract byte[] column_blob(long stmt,
int col)
throws SQLException
stmt - Pointer to the statement.col - Number of column.SQLExceptionpublic abstract double column_double(long stmt,
int col)
throws SQLException
stmt - Pointer to the statement.col - Number of column.SQLExceptionpublic abstract long column_long(long stmt,
int col)
throws SQLException
stmt - Pointer to the statement.col - Number of column.SQLExceptionpublic abstract int column_int(long stmt,
int col)
throws SQLException
stmt - Pointer to the statement.col - Number of column.SQLExceptionpublic abstract void result_null(long context)
throws SQLException
context - Pointer to the SQLite database context.SQLExceptionpublic abstract void result_text(long context,
String val)
throws SQLException
context - Pointer to the SQLite database context.val - Result value of an SQL function.SQLExceptionpublic abstract void result_blob(long context,
byte[] val)
throws SQLException
context - Pointer to the SQLite database context.val - Result value of an SQL function.SQLExceptionpublic abstract void result_double(long context,
double val)
throws SQLException
context - Pointer to the SQLite database context.val - Result value of an SQL function.SQLExceptionpublic abstract void result_long(long context,
long val)
throws SQLException
context - Pointer to the SQLite database context.val - Result value of an SQL function.SQLExceptionpublic abstract void result_int(long context,
int val)
throws SQLException
context - Pointer to the SQLite database context.val - Result value of an SQL function.SQLExceptionpublic abstract void result_error(long context,
String err)
throws SQLException
context - Pointer to the SQLite database context.err - Error result of an SQL function.SQLExceptionpublic 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.SQLExceptionpublic 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.SQLExceptionpublic 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.SQLExceptionpublic 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.SQLExceptionpublic 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.SQLExceptionpublic 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.SQLExceptionpublic abstract int create_function(String name, Function f, 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_DETERMINISTICSQLExceptionpublic abstract int destroy_function(String name) throws SQLException
name - Name of the function to de-registered.SQLExceptionpublic 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.SQLExceptionpublic 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.SQLExceptionpublic abstract void register_progress_handler(int vmCalls,
ProgressHandler progressHandler)
throws SQLException
SQLExceptionpublic abstract void clear_progress_handler()
throws SQLException
SQLExceptionpublic final String[] column_names(long stmt) throws SQLException
stmt - Stmt object.SQLExceptionpublic final boolean execute(CoreStatement stmt, Object[] vals) throws SQLException
stmt - Stmt object.vals - Array of parameter values.SQLExceptionpublic final int executeUpdate(CoreStatement stmt, Object[] vals) throws SQLException
stmt - Stmt object.vals - Array of parameter values.SQLExceptionpublic final void throwex(int errorCode)
throws SQLException
errorCode - Error code to be passed.SQLExceptionpublic static SQLiteException newSQLException(int errorCode, String errorMessage)
errorCode - Error code to be passed.errorMessage - Error message to be passed.SQLExceptionCopyright © 2019. All rights reserved.