org.sqlite
Class Database

java.lang.Object
  extended by org.sqlite.Database
All Implemented Interfaces:
Closeable

public class Database
extends java.lang.Object
implements Closeable

sqlite3 wrapper class.
NOTE: SQLite 3.5.7 based.


Field Summary
protected  java.util.Map<java.lang.String,java.lang.String> info
          database properties
 
Constructor Summary
Database(java.lang.String filename, java.util.Map<java.lang.String,java.lang.String> info)
          open database.
 
Method Summary
 void beginTransaction(TransactionType type)
          begin transaction.
 int changes()
          invoke sqlite3_changes() function.
 void clearAuthorizer()
          invoke org.sqlite.auth.Authorizer#unregister() function.
 void clearBusyHandler()
          invoke org.sqlite.event.BusyHandler#unregister() function.
 void clearCollationNeededHandler()
          invoke org.sqlite.event.CollationNeededHandler#unregister(() method.
 void clearCommitHook()
          invoke org.sqlite.event.CommitHook#clear() method.
 void clearProfiler()
          invoke org.sqlite.profiler.Profiler#clear() method.
 void clearProgressHandler()
          invoke org.sqlite.event.ProgressHandler#unregister() method.
 void clearRollbackHook()
          invoke org.sqlite.event.RollbackHook#clear() function.
 void clearTracer()
          invoke org.sqlite.profiler.Tracer#clear() method.
 void clearUpdateHook()
          invoke org.sqlite.event.UpdateHook#clear() method.
 void close()
          invoke sqlite3_close() function.
 void commitTransaction()
          commit toransaction.
 void createCollationSequence(Collator col)
          invoke org.sqlite.text.Collator#register() method.
 void createFunction(Function func)
          invoke org.sqlite.udf.Function#register() method.
 void disableExtendedResultCodes()
          invoke sqlite3_extended_result_codes(off) function.
 void disableLoadExtention()
          invoke sqlite3_enable_load_extension(off) function.
static void disableSharedCache()
          invoke sqlite3_enable_shared_cache(off) function.
 void dropCollationSequence(Collator col)
          invoke org.sqlite.text.Collator#unregister() method.
 void dropFunction(Function func)
          invoke org.sqlite.udf.Function#unregister() method.
 void enableExtendedResultCodes()
          invoke sqlite3_extended_result_codes(on) function.
 void enableLoadExtention()
          invoke sqlite3_enable_load_extension(on) function.
static void enableSharedCache()
          invoke sqlite3_enable_shared_cache(on) function.
 void execute(java.lang.String sql)
          invoke sqlite3_exec() function.
 void execute(java.lang.String sql, ExecCallback callback, SWIGTYPE_p_p_char errmsg)
          invoke sqlite3_exec() function.
 void fileControl(java.lang.String dbName, int op, SWIGTYPE_p_void arg)
          invoke sqlite3_file_control() function.
protected  void finalize()
          Close database if database is not closed yet.
static SWIGTYPE_p_sqlite3_vfs findVFS(java.lang.String vfsName)
          invoke sqlite3_vfs_find() function.
 boolean getAutoCommit()
          invoke sqlite3_get_autocommit() function.
 int getBusyTimeout()
          Returns the value of timeout(ms).
 ColumnMetaData getColumnMetaData(java.lang.String dbName, java.lang.String tableName, java.lang.String columnName)
          invoke sqlite3_table_column_metadata() function.
 int getLastError()
          invoke sqlite3_errcode() function.
 java.lang.String getLastErrorMessage()
          invoke sqlite3_errmsg() function.
static java.lang.String getProductName()
          It always returns "SQLite".
 java.util.List<java.lang.String[]> getTable(java.lang.String sql, SWIGTYPE_p_p_char errmsg)
          invoke sqlite3_get_table() function.
static long highwaterMemory(boolean reset)
          invoke sqlite3_memory_highwater() function.
 void interrupt()
          invoke sqlite3_interrupt() function.
 boolean isClosed()
          Retrieves whether this Database object has been closed.
 boolean isInMemoryMode()
          true is returned for the In-Memory mode.
 boolean isReadOnly()
          Retrieves whether this database is in read-only mode.
static boolean isThreadSafe()
          invoke sqlite3_threadsafe() function.
 long lastInsertRowId()
          invoke sqlite3_last_insert_rowid() function.
 void loadExtention(java.lang.String filename, java.lang.String entryPoint, SWIGTYPE_p_p_char errmsg)
          invoke sqlite3_load_extension() function.
protected  void open(java.lang.String filename)
          invoke sqlite3_open() or sqlite3_open_v2() function.
 Blob openBlob(java.lang.String dbName, java.lang.String tableName, java.lang.String columnName, long rowId, int flag)
          invoke sqlite3_blob_open() function.
 void pragma(java.lang.String[] commands)
          execute PRAGMA commands by sqlite3_exec() finction.
 Statement prepare(java.lang.String sql)
          create UNMANAGED Statement instance.
 Statement prepare(java.lang.String sql, SQLite3.SQLite3StmtPtrPtr ppStmt)
          create MANAGED Statement instance.
 java.util.List<Statement> prepareMultiple(java.lang.String sql)
          create multiple UNMANAGED Statement instance.
static void registerVFS(SWIGTYPE_p_sqlite3_vfs vfs, boolean makeDefault)
          invoke sqlite3_vfs_register() function.
static void resetAutoExtention()
          invoke sqlite3_reset_auto_extension() function.
 void rollbackTransaction()
          rollback transaction.
 void setAuthorizer(Authorizer auth)
          invoke org.sqlite.auth.Authorizer#register() method.
 void setBusyHandler(BusyHandler busy)
          invoke org.sqlite.event.BusyHandler#register() method.
 void setBusyTimeout(int ms)
          invoke sqlite3_busy_timeout() function.
 void setCollationNeededHandler(CollationNeededHandler needed)
          invoke org.sqlite.event.CollationNeededHandler#register() method.
 void setCommitHook(CommitHook hook)
          invoke org.sqlite.event.CommitHook#register() method.
 void setProfiler(Profiler profiler)
          invoke org.sqlite.profiler.Profiler#register() method.
 void setProgressHandler(ProgressHandler prog)
          invoke org.sqlite.event.ProgressHandler#register() method.
 void setRollbackHook(RollbackHook hook)
          invoke org.sqlite.event.RollbackHook#register() method.
 void setTracer(Tracer tracer)
          invoke org.sqlite.profiler.Tracer#register() method.
 void setUpdateHook(UpdateHook hook)
          invoke org.sqlite.event.UpdateHook#register() method.
 int totalChanges()
          invoke sqlite3_total_changes() function.
static void unregisterVFS(SWIGTYPE_p_sqlite3_vfs vfs)
          invoke sqlite3_vfs_unregister() function.
static long usedMemory()
          invoke sqlite3_memory_used() function.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

protected final java.util.Map<java.lang.String,java.lang.String> info
database properties

Constructor Detail

Database

public Database(java.lang.String filename,
                java.util.Map<java.lang.String,java.lang.String> info)
         throws java.sql.SQLException
open database.

Parameters:
filename - database file path
info - database properties. Changes the temporary directory by "TEMP_DIR" property.
Throws:
java.sql.SQLException - When the return value of the sqlite3_open() function is not SQLITE_OK.
See Also:
Name Of The Folder Holding Temporary Files
Method Detail

getProductName

public static java.lang.String getProductName()
It always returns "SQLite".

Returns:
"SQLite"

isInMemoryMode

public boolean isInMemoryMode()
true is returned for the In-Memory mode.

Returns:
true is returned for the In-Memory mode.

open

protected void open(java.lang.String filename)
             throws java.sql.SQLException
invoke sqlite3_open() or sqlite3_open_v2() function.

Parameters:
filename - database file path
Throws:
java.sql.SQLException - When the return value of the sqlite3_open() or sqlite3_open_v2() function is not SQLITE_OK.
See Also:
Opening A New Database Connection

isReadOnly

public boolean isReadOnly()
Retrieves whether this database is in read-only mode.

Returns:
true if so; false otherwise

isClosed

public boolean isClosed()
Retrieves whether this Database object has been closed.

Specified by:
isClosed in interface Closeable
Returns:
true if this Database object is closed. false if it is still open.

close

public void close()
           throws java.sql.SQLException
invoke sqlite3_close() function.

Specified by:
close in interface Closeable
Throws:
java.sql.SQLException - When the return value of the sqlite3_close() function is not SQLITE_OK.
See Also:
Closing A Database Connection

getAutoCommit

public boolean getAutoCommit()
invoke sqlite3_get_autocommit() function.

Returns:
true if auto commit mode.
See Also:
Test To See If The Database Is In Auto-Commit Mode

setBusyTimeout

public void setBusyTimeout(int ms)
                    throws java.sql.SQLException
invoke sqlite3_busy_timeout() function.

Parameters:
ms - milliseconds
Throws:
java.sql.SQLException - When the return value of the sqlite3_busy_timeout() function is not SQLITE_OK.
See Also:
Set A Busy Timeout

getBusyTimeout

public int getBusyTimeout()
Returns the value of timeout(ms).

Returns:
timeout(ms) value.

execute

public void execute(java.lang.String sql)
             throws java.sql.SQLException
invoke sqlite3_exec() function.

Parameters:
sql - SQL to be evaluated
Throws:
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
See Also:
One-Step Query Execution Interface, execute(String, ExecCallback, SWIGTYPE_p_p_char)

execute

public void execute(java.lang.String sql,
                    ExecCallback callback,
                    SWIGTYPE_p_p_char errmsg)
             throws java.sql.SQLException
invoke sqlite3_exec() function.

Parameters:
sql - SQL to be evaluated
callback - callback object
errmsg - Error message written here
Throws:
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
See Also:
One-Step Query Execution Interface

pragma

public void pragma(java.lang.String[] commands)
            throws java.sql.SQLException
execute PRAGMA commands by sqlite3_exec() finction.

Parameters:
commands - the command list without semicolon
Throws:
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
See Also:
Pragma statements supported by SQLite, execute(String)

beginTransaction

public void beginTransaction(TransactionType type)
                      throws java.sql.SQLException
begin transaction.

Parameters:
type - transaction type.
Throws:
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
See Also:
BEGIN TRANSACTION

commitTransaction

public void commitTransaction()
                       throws java.sql.SQLException
commit toransaction.

Throws:
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
See Also:
BEGIN TRANSACTION

rollbackTransaction

public void rollbackTransaction()
                         throws java.sql.SQLException
rollback transaction.

Throws:
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
See Also:
BEGIN TRANSACTION

prepare

public Statement prepare(java.lang.String sql,
                         SQLite3.SQLite3StmtPtrPtr ppStmt)
                  throws java.sql.SQLException
create MANAGED Statement instance.

Parameters:
sql - SQL to be evaluated
ppStmt - SQLite3StmtPtrPtr object
Returns:
Statement object
Throws:
java.sql.SQLException - When the return value of the sqlite3_prepare_v2() function is not SQLITE_OK.
See Also:
Compiling An SQL Statement

prepare

public Statement prepare(java.lang.String sql)
                  throws java.sql.SQLException
create UNMANAGED Statement instance.

Parameters:
sql - SQL to be evaluated
Returns:
Statement object
Throws:
java.sql.SQLException - When the return value of the sqlite3_prepare_v2() function is not SQLITE_OK.
See Also:
Compiling An SQL Statement

prepareMultiple

public java.util.List<Statement> prepareMultiple(java.lang.String sql)
                                          throws java.sql.SQLException
create multiple UNMANAGED Statement instance.

Parameters:
sql - SQL to be evaluated
Returns:
array of Statement
Throws:
java.sql.SQLException - When the return value of the sqlite3_prepare_v2() function is not SQLITE_OK.
See Also:
Compiling An SQL Statement

interrupt

public void interrupt()
invoke sqlite3_interrupt() function.

See Also:
Interrupt A Long-Running Query

changes

public int changes()
invoke sqlite3_changes() function.

Returns:
the number of database rows that were changed or inserted or deleted by the most recently completed SQL statement on the connection specified.
See Also:
Count The Number Of Rows Modified, totalChanges()

totalChanges

public int totalChanges()
invoke sqlite3_total_changes() function.

Returns:
the number of row changes caused by INSERT, UPDATE or DELETE statements since the database handle was opened.
See Also:
Total Number Of Rows Modified, changes()

lastInsertRowId

public long lastInsertRowId()
invoke sqlite3_last_insert_rowid() function.

Returns:
the rowid of the most recent successful INSERT into the database from the database connection.
See Also:
Last Insert Rowid

getColumnMetaData

public ColumnMetaData getColumnMetaData(java.lang.String dbName,
                                        java.lang.String tableName,
                                        java.lang.String columnName)
                                 throws java.sql.SQLException
invoke sqlite3_table_column_metadata() function.

Parameters:
dbName - database name
tableName - table name
columnName - column name
Returns:
the meta-data about a specific column of a specific database table accessible using the connection.
Throws:
java.sql.SQLException - When the return value of the sqlite3_table_column_metadata() function is not SQLITE_OK.
See Also:
Extract Metadata About A Column Of A Table

createFunction

public void createFunction(Function func)
                    throws java.sql.SQLException
invoke org.sqlite.udf.Function#register() method.

Parameters:
func - User-Defined function
Throws:
java.sql.SQLException - When the return value of the sqlite3_create_function() function is not SQLITE_OK.
See Also:
Function.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

dropFunction

public void dropFunction(Function func)
                  throws java.sql.SQLException
invoke org.sqlite.udf.Function#unregister() method.

Parameters:
func - User-Defined function
Throws:
java.sql.SQLException - When the return value of the sqlite3_create_function() function is not SQLITE_OK.
See Also:
Function.unregister(org.sqlite.swig.SWIGTYPE_p_sqlite3)

createCollationSequence

public void createCollationSequence(Collator col)
                             throws java.sql.SQLException
invoke org.sqlite.text.Collator#register() method.

Parameters:
col - User-Defined Collating Sequences
Throws:
java.sql.SQLException - When the return value of the sqlite3_create_collation_v2() function is not SQLITE_OK.
See Also:
Collator.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

dropCollationSequence

public void dropCollationSequence(Collator col)
                           throws java.sql.SQLException
invoke org.sqlite.text.Collator#unregister() method.

Parameters:
col - User-Defined Collating Sequences
Throws:
java.sql.SQLException - When the return value of the sqlite3_create_collation() function is not SQLITE_OK.
See Also:
Collator.unregister(org.sqlite.swig.SWIGTYPE_p_sqlite3)

setAuthorizer

public void setAuthorizer(Authorizer auth)
                   throws java.sql.SQLException
invoke org.sqlite.auth.Authorizer#register() method.

Parameters:
auth - authorizer
Throws:
java.sql.SQLException - When the return value of the sqlite3_set_authorizer() function is not SQLITE_OK.
See Also:
Authorizer.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

clearAuthorizer

public void clearAuthorizer()
                     throws java.sql.SQLException
invoke org.sqlite.auth.Authorizer#unregister() function.

Throws:
java.sql.SQLException - When the return value of the sqlite3_set_authorizer() function is not SQLITE_OK.
See Also:
Authorizer.unregister(org.sqlite.swig.SWIGTYPE_p_sqlite3)

setBusyHandler

public void setBusyHandler(BusyHandler busy)
                    throws java.sql.SQLException
invoke org.sqlite.event.BusyHandler#register() method.

Parameters:
busy - busy handler
Throws:
java.sql.SQLException - When the return value of the sqlite3_busy_handler() function is not SQLITE_OK.
See Also:
BusyHandler.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

clearBusyHandler

public void clearBusyHandler()
                      throws java.sql.SQLException
invoke org.sqlite.event.BusyHandler#unregister() function.

Throws:
java.sql.SQLException - When the return value of the sqlite3_busy_handler() function is not SQLITE_OK.
See Also:
BusyHandler.unregister(org.sqlite.swig.SWIGTYPE_p_sqlite3)

setCollationNeededHandler

public void setCollationNeededHandler(CollationNeededHandler needed)
                               throws java.sql.SQLException
invoke org.sqlite.event.CollationNeededHandler#register() method.

Parameters:
needed - the CollationNeededHandler object
Throws:
java.sql.SQLException - When the return value of the sqlite3_collation_needed() function is not SQLITE_OK.
See Also:
CollationNeededHandler.register(org.sqlite.swig.SWIGTYPE_p_sqlite3), CollationNeededHandler.setDatabase(Database)

clearCollationNeededHandler

public void clearCollationNeededHandler()
                                 throws java.sql.SQLException
invoke org.sqlite.event.CollationNeededHandler#unregister(() method.

Throws:
java.sql.SQLException - When the return value of the sqlite3_collation_needed() function is not SQLITE_OK.
See Also:
CollationNeededHandler.unregister(org.sqlite.swig.SWIGTYPE_p_sqlite3)

setProgressHandler

public void setProgressHandler(ProgressHandler prog)
invoke org.sqlite.event.ProgressHandler#register() method.

Parameters:
prog - progress handler
See Also:
ProgressHandler.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

clearProgressHandler

public void clearProgressHandler()
invoke org.sqlite.event.ProgressHandler#unregister() method.

See Also:
ProgressHandler.unregister(org.sqlite.swig.SWIGTYPE_p_sqlite3)

setCommitHook

public void setCommitHook(CommitHook hook)
invoke org.sqlite.event.CommitHook#register() method.

Parameters:
hook - commit hoot
See Also:
CommitHook.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

clearCommitHook

public void clearCommitHook()
invoke org.sqlite.event.CommitHook#clear() method.

See Also:
CommitHook.clear(org.sqlite.swig.SWIGTYPE_p_sqlite3)

setRollbackHook

public void setRollbackHook(RollbackHook hook)
invoke org.sqlite.event.RollbackHook#register() method.

Parameters:
hook - rollback hoot
See Also:
RollbackHook.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

clearRollbackHook

public void clearRollbackHook()
invoke org.sqlite.event.RollbackHook#clear() function.

See Also:
RollbackHook.clear(org.sqlite.swig.SWIGTYPE_p_sqlite3)

setUpdateHook

public void setUpdateHook(UpdateHook hook)
invoke org.sqlite.event.UpdateHook#register() method.

Parameters:
hook - update hoot
See Also:
UpdateHook.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

clearUpdateHook

public void clearUpdateHook()
invoke org.sqlite.event.UpdateHook#clear() method.

See Also:
UpdateHook.clear(org.sqlite.swig.SWIGTYPE_p_sqlite3)

setProfiler

public void setProfiler(Profiler profiler)
invoke org.sqlite.profiler.Profiler#register() method.

Parameters:
profiler - profiler
See Also:
Profiler.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

clearProfiler

public void clearProfiler()
invoke org.sqlite.profiler.Profiler#clear() method.

See Also:
Profiler.clear(org.sqlite.swig.SWIGTYPE_p_sqlite3)

setTracer

public void setTracer(Tracer tracer)
invoke org.sqlite.profiler.Tracer#register() method.

Parameters:
tracer - tracer
See Also:
Tracer.register(org.sqlite.swig.SWIGTYPE_p_sqlite3)

clearTracer

public void clearTracer()
invoke org.sqlite.profiler.Tracer#clear() method.

See Also:
Tracer.clear(org.sqlite.swig.SWIGTYPE_p_sqlite3)

enableSharedCache

public static void enableSharedCache()
                              throws java.sql.SQLException
invoke sqlite3_enable_shared_cache(on) function.

Throws:
java.sql.SQLException - When the return value of the sqlite3_enable_shared_cache() function is not SQLITE_OK.
See Also:
Enable Or Disable Shared Pager Cache

disableSharedCache

public static void disableSharedCache()
                               throws java.sql.SQLException
invoke sqlite3_enable_shared_cache(off) function.

Throws:
java.sql.SQLException - When the return value of the sqlite3_enable_shared_cache() function is not SQLITE_OK.
See Also:
Enable Or Disable Shared Pager Cache

getLastError

public int getLastError()
invoke sqlite3_errcode() function.

Returns:
the numeric result code or extended result code for the most recent failed sqlite3_* API call associated with sqlite3 handle 'db'.
See Also:
Error Codes And Messages, Result Codes, Extended Result Codes, enableExtendedResultCodes(), disableExtendedResultCodes()

getLastErrorMessage

public java.lang.String getLastErrorMessage()
invoke sqlite3_errmsg() function.

Returns:
the numeric result code or extended result code for the most recent failed sqlite3_* API call associated with sqlite3 handle 'db'.
See Also:
Error Codes And Messages, getLastError(), enableExtendedResultCodes(), disableExtendedResultCodes()

getTable

public java.util.List<java.lang.String[]> getTable(java.lang.String sql,
                                                   SWIGTYPE_p_p_char errmsg)
                                            throws java.sql.SQLException
invoke sqlite3_get_table() function.

Parameters:
sql - SQL to be evaluated
errmsg - Error message written here
Returns:
Results of the query
Throws:
java.sql.SQLException - When the return value of the sqlite3_get_table() function is not SQLITE_OK.
See Also:
Convenience Routines For Running Queries

enableExtendedResultCodes

public void enableExtendedResultCodes()
                               throws java.sql.SQLException
invoke sqlite3_extended_result_codes(on) function.

Throws:
java.sql.SQLException - When the return value of the sqlite3_extended_result_codes() function is not SQLITE_OK.
See Also:
Enable Or Disable Extended Result Codes

disableExtendedResultCodes

public void disableExtendedResultCodes()
                                throws java.sql.SQLException
invoke sqlite3_extended_result_codes(off) function.

Throws:
java.sql.SQLException - When the return value of the sqlite3_extended_result_codes() function is not SQLITE_OK.
See Also:
Enable Or Disable Extended Result Codes

enableLoadExtention

public void enableLoadExtention()
                         throws java.sql.SQLException
invoke sqlite3_enable_load_extension(on) function.

Throws:
java.sql.SQLException - When the return value of the sqlite3_enable_load_extension() function is not SQLITE_OK.
See Also:
Enable Or Disable Extension Loading

disableLoadExtention

public void disableLoadExtention()
                          throws java.sql.SQLException
invoke sqlite3_enable_load_extension(off) function.

Throws:
java.sql.SQLException - When the return value of the sqlite3_enable_load_extension() function is not SQLITE_OK.
See Also:
Enable Or Disable Extension Loading

loadExtention

public void loadExtention(java.lang.String filename,
                          java.lang.String entryPoint,
                          SWIGTYPE_p_p_char errmsg)
                   throws java.sql.SQLException
invoke sqlite3_load_extension() function.

Parameters:
filename - the Name of the shared library containing extension
entryPoint - the Entry point. Use "sqlite3_extension_init" if null.
errmsg - Error message written here
Throws:
java.sql.SQLException - When the return value of the sqlite3_load_extension() function is not SQLITE_OK.
See Also:
Load An Extension

resetAutoExtention

public static void resetAutoExtention()
invoke sqlite3_reset_auto_extension() function.

See Also:
Reset Automatic Extension Loading

isThreadSafe

public static boolean isThreadSafe()
invoke sqlite3_threadsafe() function.

Returns:
true if the library is threadsafe
See Also:
Test To See If The Library Is Threadsafe

highwaterMemory

public static long highwaterMemory(boolean reset)
invoke sqlite3_memory_highwater() function.

Parameters:
reset - true if the memory highwater mark is reset.
Returns:
the maximum value of sqlite3_memory_used() since the highwater mark was last reset.
See Also:
Memory Allocator Statistics, usedMemory()

usedMemory

public static long usedMemory()
invoke sqlite3_memory_used() function.

Returns:
the number of bytes of memory currently outstanding (malloced but not freed).
See Also:
Memory Allocator Statistics, highwaterMemory(boolean)

findVFS

public static SWIGTYPE_p_sqlite3_vfs findVFS(java.lang.String vfsName)
invoke sqlite3_vfs_find() function.

Parameters:
vfsName - the VFS name are case sensitive.
Returns:
the pointer to a VFS. if vfsName is null then the default VFS is returned.
See Also:
Virtual File System Objects, registerVFS(SWIGTYPE_p_sqlite3_vfs, boolean), unregisterVFS(SWIGTYPE_p_sqlite3_vfs)

registerVFS

public static void registerVFS(SWIGTYPE_p_sqlite3_vfs vfs,
                               boolean makeDefault)
                        throws java.sql.SQLException
invoke sqlite3_vfs_register() function.

Parameters:
vfs - the VFS object.
makeDefault - Each new VFS becomes the default VFS if the makeDefault flag is true.
Throws:
java.sql.SQLException - When the return value of the sqlite3_vfs_register() function is not SQLITE_OK.
See Also:
findVFS(java.lang.String), unregisterVFS(SWIGTYPE_p_sqlite3_vfs)

unregisterVFS

public static void unregisterVFS(SWIGTYPE_p_sqlite3_vfs vfs)
                          throws java.sql.SQLException
invoke sqlite3_vfs_unregister() function.

Parameters:
vfs - the registered VFS object.
Throws:
java.sql.SQLException - When the return value of the sqlite3_vfs_unregister() function is not SQLITE_OK.
See Also:
registerVFS(SWIGTYPE_p_sqlite3_vfs, boolean)

fileControl

public void fileControl(java.lang.String dbName,
                        int op,
                        SWIGTYPE_p_void arg)
                 throws java.sql.SQLException
invoke sqlite3_file_control() function.

Parameters:
dbName - the name "main" or a null.
op - the parameters to this routine are passed directly through to the second parameters of the xFileControl method.
arg - the parameters to this routine are passed directly through to the third parameters of the xFileControl method.
Throws:
java.sql.SQLException - When the return value of the sqlite3_file_control() function is not SQLITE_OK.

openBlob

public Blob openBlob(java.lang.String dbName,
                     java.lang.String tableName,
                     java.lang.String columnName,
                     long rowId,
                     int flag)
              throws java.sql.SQLException
invoke sqlite3_blob_open() function.

Parameters:
dbName - the database name
tableName - the table name
columnName - the column name
rowId - the ROWID
flag - If the flags parameter is non-zero, the blob is opened for read and write access. If it is zero, the blob is opened for read access.
Returns:
the sqlite3_blob object
Throws:
java.sql.SQLException - When the return value of the sqlite3_blob_open() function is not SQLITE_OK.
See Also:
Open A BLOB For Incremental I/O

finalize

protected void finalize()
                 throws java.lang.Throwable
Close database if database is not closed yet.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable
See Also:
close()