Methods Summary |
---|
private native void | _busy_handler(SQLite.BusyHandler bh)
|
private native void | _busy_timeout(int ms)
|
private native long | _changes()
|
private native void | _close()
|
private static native boolean | _complete(java.lang.String sql)
|
private native void | _create_aggregate(java.lang.String name, int nargs, Function f)
|
private native void | _create_function(java.lang.String name, int nargs, Function f)
|
private native java.lang.String | _errmsg()
|
private native void | _exec(java.lang.String sql, SQLite.Callback cb)
|
private native void | _exec(java.lang.String sql, SQLite.Callback cb, java.lang.String[] args)
|
private native void | _finalize()
|
private native void | _function_type(java.lang.String name, int type)
|
private native void | _interrupt()
|
private native long | _last_insert_rowid()
|
private native void | _open(java.lang.String filename, int mode)
|
private native void | _open_aux_file(java.lang.String filename)
|
private native void | _open_blob(java.lang.String db, java.lang.String table, java.lang.String column, long row, boolean rw, Blob blob)Internal SQLite open blob method.
|
private native void | _progress_handler(int n, SQLite.ProgressHandler p)
|
private native void | _set_authorizer(Authorizer auth)
|
private native void | _set_encoding(java.lang.String enc)
|
private native void | _trace(Trace tr)
|
public void | busy_handler(SQLite.BusyHandler bh)Establish a busy callback method which gets called when
an SQLite table is locked.
synchronized(this) {
_busy_handler(bh);
}
|
public void | busy_timeout(int ms)Set the timeout for waiting for an SQLite table to become
unlocked.
synchronized(this) {
_busy_timeout(ms);
}
|
public long | changes()Return the number of changed rows for the last statement.
synchronized(this) {
return _changes();
}
|
public void | close()Close the underlying SQLite database file.
synchronized(this) {
_close();
}
|
public Vm | compile(java.lang.String sql)Compile and return SQLite VM for SQL statement. Only available
in SQLite 2.8.0 and above, otherwise a no-op.
synchronized(this) {
Vm vm = new Vm();
vm_compile(sql, vm);
return vm;
}
|
public Vm | compile(java.lang.String sql, java.lang.String[] args)Compile and return SQLite VM for SQL statement. Only available
in SQLite 3.0 and above, otherwise a no-op.
synchronized(this) {
Vm vm = new Vm();
vm_compile_args(sql, vm, args);
return vm;
}
|
public static synchronized boolean | complete(java.lang.String sql)See if an SQL statement is complete.
Returns true if the input string comprises
one or more complete SQL statements.
return _complete(sql);
|
public void | create_aggregate(java.lang.String name, int nargs, Function f)Create aggregate function.
synchronized(this) {
_create_aggregate(name, nargs, f);
}
|
public void | create_function(java.lang.String name, int nargs, Function f)Create regular function.
synchronized(this) {
_create_function(name, nargs, f);
}
|
public native java.lang.String | dbversion()Return SQLite version number as string.
If the database is not open, unknown is returned.
|
public java.lang.String | error_message()Return last error message of SQLite3 engine.
synchronized(this) {
return _errmsg();
}
|
public static native java.lang.String | error_string(int error_code)Return error string given SQLite error code (SQLite2).
|
public void | exec(java.lang.String sql, SQLite.Callback cb, java.lang.String[] args)Execute an SQL statement and invoke callback methods
for each row of the result set. Each '%q' or %Q in the
statement string is substituted by its corresponding
element in the argument vector.
Example:
String args[] = new String[1];
args[0] = "tab%";
db.exec("select * from sqlite_master where type like '%q'",
null, args);
It the method fails, an SQLite.Exception is thrown and
an error code is set, which later can be retrieved by
the last_error() method.
synchronized(this) {
_exec(sql, cb, args);
}
|
public void | exec(java.lang.String sql, SQLite.Callback cb)Execute an SQL statement and invoke callback methods
for each row of the result set.
It the method fails, an SQLite.Exception is thrown and
an error code is set, which later can be retrieved by
the last_error() method.
synchronized(this) {
_exec(sql, cb);
}
|
protected void | finalize()Destructor for object.
synchronized(this) {
_finalize();
}
|
public void | function_type(java.lang.String name, int type)Set function return type. Only available in SQLite 2.6.0 and
above, otherwise a no-op.
synchronized(this) {
_function_type(name, type);
}
|
public TableResult | get_table(java.lang.String sql)Convenience method to retrieve an entire result
set into memory.
TableResult ret = new TableResult();
if (!is3()) {
exec(sql, ret);
} else {
synchronized(this) {
/* only one statement !!! */
Vm vm = compile(sql);
set_last_error(vm.error_code);
while (vm.step(ret)) {
set_last_error(vm.error_code);
}
vm.finalize();
}
}
return ret;
|
public TableResult | get_table(java.lang.String sql, java.lang.String[] args)Convenience method to retrieve an entire result
set into memory.
TableResult ret = new TableResult();
if (!is3()) {
exec(sql, ret, args);
} else {
synchronized(this) {
/* only one statement !!! */
Vm vm = compile(sql, args);
set_last_error(vm.error_code);
while (vm.step(ret)) {
set_last_error(vm.error_code);
}
vm.finalize();
}
}
return ret;
|
public void | get_table(java.lang.String sql, java.lang.String[] args, TableResult tbl)Convenience method to retrieve an entire result
set into memory.
tbl.clear();
if (!is3()) {
exec(sql, tbl, args);
} else {
synchronized(this) {
/* only one statement !!! */
Vm vm = compile(sql, args);
while (vm.step(tbl)) {
}
vm.finalize();
}
}
|
private static native void | internal_init()Internal native initializer.
|
public void | interrupt()Abort the current SQLite operation.
synchronized(this) {
_interrupt();
}
|
public native boolean | is3()Check type of open database.
|
public int | last_error()Return the code of the last error occured in
any of the exec() methods. The value is valid
after an Exception has been reported by one of
these methods. See the Constants
class for possible values.
return error_code;
|
public long | last_insert_rowid()Return the row identifier of the last inserted
row.
synchronized(this) {
return _last_insert_rowid();
}
|
public void | open(java.lang.String filename, int mode)Open an SQLite database file.
synchronized(this) {
_open(filename, mode);
}
|
public void | open_aux_file(java.lang.String filename)Open SQLite auxiliary database file for temporary
tables.
synchronized(this) {
_open_aux_file(filename);
}
|
public Blob | open_blob(java.lang.String db, java.lang.String table, java.lang.String column, long row, boolean rw)Open an SQLite3 blob. Only available in SQLite 3.4.0 and above.
synchronized(this) {
Blob blob = new Blob();
_open_blob(db, table, column, row, rw, blob);
return blob;
}
|
public Stmt | prepare(java.lang.String sql)Prepare and return SQLite3 statement for SQL. Only available
in SQLite 3.0 and above, otherwise a no-op.
synchronized(this) {
Stmt stmt = new Stmt();
stmt_prepare(sql, stmt);
return stmt;
}
|
public void | progress_handler(int n, SQLite.ProgressHandler p)Establish a progress callback method which gets called after
N SQLite VM opcodes.
synchronized(this) {
_progress_handler(n, p);
}
|
public void | set_authorizer(Authorizer auth)Set authorizer function. Only available in SQLite 2.7.6 and
above, otherwise a no-op.
synchronized(this) {
_set_authorizer(auth);
}
|
public void | set_encoding(java.lang.String enc)Set character encoding.
synchronized(this) {
_set_encoding(enc);
}
|
protected void | set_last_error(int error_code)Internal: set error code.
this.error_code = error_code;
|
private native void | stmt_prepare(java.lang.String sql, Stmt stmt)Internal SQLite3 prepare method.
|
public void | trace(Trace tr)Set trace function. Only available in SQLite 2.7.6 and above,
otherwise a no-op.
synchronized(this) {
_trace(tr);
}
|
public static native java.lang.String | version()Return SQLite version number as string.
Don't rely on this when both SQLite 2 and 3 are compiled
into the native part. Use the class method in this case.
|
private native void | vm_compile(java.lang.String sql, Vm vm)Internal compile method.
|
private native void | vm_compile_args(java.lang.String sql, Vm vm, java.lang.String[] args)Internal compile method, SQLite 3.0 only.
|