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 |
---|
NativeDB(String url,
String fileName,
SQLiteConfig config) |
Modifier and Type | Method and Description |
---|---|
protected void |
_close()
Closes the SQLite interface to a database.
|
int |
_exec(String sql)
Complies, evaluates, executes and commits an SQL statement.
|
protected void |
_open(String file,
int openFlags)
Creates an SQLite interface to a database with the provided open flags.
|
int |
backup(String dbName,
String destFileName,
DB.ProgressObserver observer) |
void |
busy_handler(BusyHandler busyHandler)
Sets a busy handler that sleeps
for a specified amount of time when a table is locked.
|
void |
busy_timeout(int ms)
Sets a busy handler that sleeps
for a specified amount of time when a table is locked.
|
int |
changes() |
int |
clear_bindings(long stmt)
Reset all bindings on a prepared statement (reset all host parameters to NULL).
|
void |
clear_progress_handler() |
byte[] |
column_blob(long stmt,
int col) |
int |
column_count(long stmt) |
String |
column_decltype(long stmt,
int col) |
double |
column_double(long stmt,
int col) |
int |
column_int(long stmt,
int col) |
long |
column_long(long stmt,
int col) |
String |
column_name(long stmt,
int col) |
String |
column_table_name(long stmt,
int col) |
String |
column_text(long stmt,
int col) |
int |
column_type(long stmt,
int col) |
int |
create_function(String name,
Function func,
int flags)
Create a user defined function with given function name and the function object.
|
int |
destroy_function(String name)
De-registers a user defined function
|
int |
enable_load_extension(boolean enable)
Enables or disables loading of SQLite extensions.
|
protected int |
finalize(long stmt)
Destroys a prepared statement.
|
void |
interrupt()
Aborts any pending operation and returns at its earliest opportunity.
|
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 boolean |
load()
Loads the SQLite interface backend.
|
protected long |
prepare(String sql)
Complies an SQL statement.
|
void |
register_progress_handler(int vmCalls,
ProgressHandler progressHandler)
Progress handler
|
int |
reset(long stmt)
Sets a prepared statement object back to its initial state,
ready to be re-executed.
|
int |
restore(String dbName,
String sourceFileName,
DB.ProgressObserver observer) |
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.
|
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.
|
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.
|
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.
|
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.
|
void |
result_null(long context)
Sets the result of an SQL function as NULL with the pointer to the SQLite database context.
|
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.
|
int |
shared_cache(boolean enable)
Enables or disables the sharing of the database cache and schema data structures between
connections to the same database.
|
int |
step(long stmt)
Evaluates a statement.
|
int |
total_changes() |
byte[] |
value_blob(Function f,
int arg) |
double |
value_double(Function f,
int arg) |
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.
|
long |
value_long(Function f,
int arg) |
String |
value_text(Function f,
int arg) |
int |
value_type(Function f,
int arg) |
close, column_names, exec, execute, executeUpdate, finalize, getConfig, getUrl, isClosed, newSQLException, open, prepare, throwex
public NativeDB(String url, String fileName, SQLiteConfig config) throws SQLException
SQLException
public static boolean load() throws Exception
Exception
protected void _open(String file, int openFlags) throws SQLException
DB
_open
in class DB
file
- The database to open.openFlags
- File opening configurations
(http://www.sqlite.org/c3ref/c_open_autoproxy.html)SQLException
DB._open(java.lang.String, int)
protected void _close() throws SQLException
DB
_close
in class DB
SQLException
DB._close()
public int _exec(String sql) throws SQLException
DB
_exec
in class DB
sql
- An SQL statement.SQLException
DB._exec(java.lang.String)
public int shared_cache(boolean enable)
DB
shared_cache
in class DB
enable
- True to enable; false otherwise.DB.shared_cache(boolean)
public int enable_load_extension(boolean enable)
DB
enable_load_extension
in class DB
enable
- True to enable; false otherwise.DB.enable_load_extension(boolean)
public void interrupt()
DB
interrupt
in class DB
DB.interrupt()
public void busy_timeout(int ms)
DB
busy_timeout
in class DB
ms
- Time to sleep in milliseconds.DB.busy_timeout(int)
public void busy_handler(BusyHandler busyHandler)
DB
busy_handler
in class DB
DB.busy_handler(BusyHandler)
protected long prepare(String sql) throws SQLException
DB
prepare
in class DB
sql
- An SQL statement.SQLException
DB.prepare(java.lang.String)
public String libversion()
DB
libversion
in class DB
DB.libversion()
public int changes()
changes
in class DB
DB.changes()
public int total_changes()
total_changes
in class DB
DB.total_changes()
protected int finalize(long stmt)
DB
finalize
in class DB
stmt
- Pointer to the statement pointer.DB.finalize(long)
public int step(long stmt)
DB
step
in class DB
stmt
- Pointer to the statement.DB.step(long)
public int reset(long stmt)
DB
reset
in class DB
stmt
- Pointer to the statement.DB.reset(long)
public int clear_bindings(long stmt)
DB
clear_bindings
in class DB
stmt
- Pointer to the statement.DB.clear_bindings(long)
public int column_count(long stmt)
column_count
in class DB
stmt
- Pointer to the statement.DB.column_count(long)
public int column_type(long stmt, int col)
column_type
in class DB
stmt
- Pointer to the statement.col
- Number of column.DB.column_type(long, int)
public String column_decltype(long stmt, int col)
column_decltype
in class DB
stmt
- Pointer to the statement.col
- Number of column.DB.column_decltype(long, int)
public String column_table_name(long stmt, int col)
column_table_name
in class DB
stmt
- Pointer to the statement.col
- Number of column.DB.column_table_name(long, int)
public String column_name(long stmt, int col)
column_name
in class DB
stmt
- Pointer to the statement.col
- The number of column.DB.column_name(long, int)
public String column_text(long stmt, int col)
column_text
in class DB
stmt
- Pointer to the statement.col
- Number of column.DB.column_text(long, int)
public byte[] column_blob(long stmt, int col)
column_blob
in class DB
stmt
- Pointer to the statement.col
- Number of column.DB.column_blob(long, int)
public double column_double(long stmt, int col)
column_double
in class DB
stmt
- Pointer to the statement.col
- Number of column.DB.column_double(long, int)
public long column_long(long stmt, int col)
column_long
in class DB
stmt
- Pointer to the statement.col
- Number of column.DB.column_long(long, int)
public int column_int(long stmt, int col)
column_int
in class DB
stmt
- Pointer to the statement.col
- Number of column.DB.column_int(long, int)
public void result_null(long context)
DB
result_null
in class DB
context
- Pointer to the SQLite database context.DB.result_null(long)
public void result_text(long context, String val)
DB
result_text
in class DB
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.DB.result_text(long, java.lang.String)
public void result_blob(long context, byte[] val)
DB
result_blob
in class DB
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.DB.result_blob(long, byte[])
public void result_double(long context, double val)
DB
result_double
in class DB
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.DB.result_double(long, double)
public void result_long(long context, long val)
DB
result_long
in class DB
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.DB.result_long(long, long)
public void result_int(long context, int val)
DB
result_int
in class DB
context
- Pointer to the SQLite database context.val
- Result value of an SQL function.DB.result_int(long, int)
public void result_error(long context, String err)
DB
result_error
in class DB
context
- Pointer to the SQLite database context.err
- Error result of an SQL function.DB.result_error(long, java.lang.String)
public String value_text(Function f, int arg)
value_text
in class DB
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.DB.value_text(org.sqlite.Function, int)
public byte[] value_blob(Function f, int arg)
value_blob
in class DB
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.DB.value_blob(org.sqlite.Function, int)
public double value_double(Function f, int arg)
value_double
in class DB
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.DB.value_double(org.sqlite.Function, int)
public long value_long(Function f, int arg)
value_long
in class DB
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.DB.value_long(org.sqlite.Function, int)
public int value_int(Function f, int arg)
DB
value_int
in class DB
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.DB.value_int(org.sqlite.Function, int)
public int value_type(Function f, int arg)
value_type
in class DB
f
- SQLite function object.arg
- Pointer to the parameter of the SQLite function or aggregate.DB.value_type(org.sqlite.Function, int)
public int create_function(String name, Function func, int flags)
DB
create_function
in class DB
name
- The function name to be created.func
- SQLite function object.flags
- Extra flags to use when creating the function, such as Function.FLAG_DETERMINISTIC
DB.create_function(java.lang.String, org.sqlite.Function, int)
public int destroy_function(String name)
DB
destroy_function
in class DB
name
- Name of the function to de-registered.DB.destroy_function(java.lang.String)
public int backup(String dbName, String destFileName, DB.ProgressObserver observer) throws SQLException
backup
in class DB
dbName
- Database name to be backed up.destFileName
- Target backup file name.observer
- ProgressObserver object.SQLException
DB.backup(java.lang.String, java.lang.String, org.sqlite.core.DB.ProgressObserver)
public int restore(String dbName, String sourceFileName, DB.ProgressObserver observer) throws SQLException
restore
in class DB
dbName
- Database name for restoring data.sourceFileName
- Source file name.observer
- ProgressObserver object.SQLException
DB.restore(java.lang.String, java.lang.String,
org.sqlite.core.DB.ProgressObserver)
public void register_progress_handler(int vmCalls, ProgressHandler progressHandler) throws SQLException
DB
register_progress_handler
in class DB
SQLException
public void clear_progress_handler() throws SQLException
clear_progress_handler
in class DB
SQLException
Copyright © 2019. All rights reserved.