|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sqlite.Database
public class Database
sqlite3 wrapper class.
NOTE: SQLite 3.3.5 based.
| Field Summary | |
|---|---|
protected java.util.Properties |
info
database properties |
| Constructor Summary | |
|---|---|
Database(java.lang.String filename,
java.util.Properties info)
open database. |
|
| Method Summary | |
|---|---|
void |
beginTransaction(TransactionType type)
begin transaction. |
int |
changes()
invoke sqlite3_changes() function. |
void |
clearAuthorizer()
invoke sqlite3_set_authorizer() function. |
void |
clearBusyHandler()
invoke sqlite3_set_authorizer() function. |
void |
clearCollationNeededHandler()
invoke sqlite3_collation_needed() function. |
void |
clearCommitHook()
invoke sqlite3_commit_hook() function. |
void |
clearProfiler()
invoke sqlite3_profile() function. |
void |
clearProgressHandler()
invoke sqlite3_progress_handler() function. |
void |
clearRollbackHook()
invoke sqlite3_rollback_hook() function. |
void |
clearTracer()
invoke sqlite3_trace() function. |
void |
clearUpdateHook()
invoke sqlite3_update_hook() function. |
void |
close()
invoke sqlite3_close() function. |
void |
commitTransaction()
commit toransaction. |
void |
createCollationSequence(Collator col)
invoke sqlite3_create_collation() function. |
void |
createFunction(Function func)
invoke sqlite3_create_function() function. |
void |
disableSharedCache()
invoke sqlite3_enable_shared_cache(false) function. |
void |
dropCollationSequence(Collator col)
invoke sqlite3_create_function() function. |
void |
dropCollationSequence(java.lang.String name)
invoke sqlite3_create_function() function. |
void |
dropFunction(Function func)
invoke sqlite3_create_function() function. |
void |
dropFunction(java.lang.String name)
invoke sqlite3_create_function() function. |
void |
enableSharedCache()
invoke sqlite3_enable_shared_cache(true) 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. |
protected void |
finalize()
Close database if database is not closed yet. |
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. |
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. |
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()
It always returns false. NOTE: The sqlite3_open_v2() function is not supported in this version. |
long |
lastInsertRowId()
invoke sqlite3_last_insert_rowid() function. |
protected void |
open(java.lang.String filename)
invoke sqlite3_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,
SQLite3StmtPtrPtr ppStmt)
create MANAGED Statement instance. |
java.util.List<Statement> |
prepareMultiple(java.lang.String sql)
create multiple UNMANAGED Statement instance. |
void |
rollbackTransaction()
rollback transaction. |
void |
setAuthorizer(Authorizer auth)
invoke sqlite3_set_authorizer() function. |
void |
setBusyHandler(BusyHandler busy)
invoke sqlite3_busy_handler() function. |
void |
setBusyTimeout(int ms)
invoke sqlite3_busy_timeout() function. |
void |
setCollationNeededHandler(CollationNeededHandler needed)
invoke sqlite3_collation_needed() function. |
void |
setCommitHook(CommitHook hook)
invoke sqlite3_commit_hook() function. |
void |
setProfiler(Profiler profiler)
invoke sqlite3_profile() function. |
void |
setProgressHandler(ProgressHandler prog)
invoke sqlite3_progress_handler() function. |
void |
setRollbackHook(RollbackHook hook)
invoke sqlite3_rollback_hook() function. |
void |
setTracer(Tracer tracer)
invoke sqlite3_trace() function. |
void |
setUpdateHook(UpdateHook hook)
invoke sqlite3_update_hook() function. |
int |
totalChanges()
invoke sqlite3_total_changes() function. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.Properties info
| Constructor Detail |
|---|
public Database(java.lang.String filename,
java.util.Properties info)
throws java.sql.SQLException
filename - database file pathinfo - database properties
java.sql.SQLException - When the return value of the sqlite3_open() function is not SQLITE_OK.| Method Detail |
|---|
public java.lang.String getProductName()
public boolean isInMemoryMode()
protected void open(java.lang.String filename)
throws java.sql.SQLException
filename - database file path
java.sql.SQLException - When the return value of the sqlite3_open() function is not SQLITE_OK.public boolean isReadOnly()
public boolean isClosed()
public void close()
throws java.sql.SQLException
java.sql.SQLException - When the return value of the sqlite3_close() function is not SQLITE_OK.public boolean getAutoCommit()
public void setBusyTimeout(int ms)
throws java.sql.SQLException
ms - milliseconds
java.sql.SQLException - When the return value of the sqlite3_busy_timeout() function is not SQLITE_OK.public int getBusyTimeout()
public void execute(java.lang.String sql)
throws java.sql.SQLException
sql - SQL to be evaluated
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.execute(String, ExecCallback, SWIGTYPE_p_p_char)
public void execute(java.lang.String sql,
ExecCallback callback,
SWIGTYPE_p_p_char errmsg)
throws java.sql.SQLException
sql - SQL to be evaluatedcallback - callback objecterrmsg - Error message written here
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
public void pragma(java.lang.String[] commands)
throws java.sql.SQLException
commands - the command list without semicolon
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.execute(String)
public void beginTransaction(TransactionType type)
throws java.sql.SQLException
type - transaction type.
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
public void commitTransaction()
throws java.sql.SQLException
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
public void rollbackTransaction()
throws java.sql.SQLException
java.sql.SQLException - When the return value of the sqlite3_exec() function is not SQLITE_OK.
public Statement prepare(java.lang.String sql,
SQLite3StmtPtrPtr ppStmt)
throws java.sql.SQLException
sql - SQL to be evaluatedppStmt - SQLite3StmtPtrPtr object
java.sql.SQLException - When the return value of the sqlite3_prepare() function is not SQLITE_OK.
public Statement prepare(java.lang.String sql)
throws java.sql.SQLException
sql - SQL to be evaluated
java.sql.SQLException - When the return value of the sqlite3_prepare() function is not SQLITE_OK.
public java.util.List<Statement> prepareMultiple(java.lang.String sql)
throws java.sql.SQLException
sql - SQL to be evaluated
java.sql.SQLException - When the return value of the sqlite3_prepare() function is not SQLITE_OK.public void interrupt()
public int changes()
totalChanges()public int totalChanges()
changes()public long lastInsertRowId()
public ColumnMetaData getColumnMetaData(java.lang.String dbName,
java.lang.String tableName,
java.lang.String columnName)
throws java.sql.SQLException
dbName - database nametableName - table namecolumnName - column name
java.sql.SQLException - When the return value of the sqlite3_table_column_metadata() function is not SQLITE_OK.
public void createFunction(Function func)
throws java.sql.SQLException
func - User-Defined function
java.sql.SQLException - When the return value of the sqlite3_create_function() function is not SQLITE_OK.
public void dropFunction(Function func)
throws java.sql.SQLException
func - User-Defined function
java.sql.SQLException - When the return value of the sqlite3_create_function() function is not SQLITE_OK.
public void dropFunction(java.lang.String name)
throws java.sql.SQLException
name - the function name
java.sql.SQLException - When the return value of the sqlite3_create_function() function is not SQLITE_OK.
public void createCollationSequence(Collator col)
throws java.sql.SQLException
col - User-Defined Collating Sequences
java.sql.SQLException - When the return value of the sqlite3_create_collation() function is not SQLITE_OK.
public void dropCollationSequence(Collator col)
throws java.sql.SQLException
col - User-Defined Collating Sequences
java.sql.SQLException - When the return value of the sqlite3_create_collation() function is not SQLITE_OK.
public void dropCollationSequence(java.lang.String name)
throws java.sql.SQLException
name - the collation sequence name
java.sql.SQLException - When the return value of the sqlite3_create_collation() function is not SQLITE_OK.
public void setAuthorizer(Authorizer auth)
throws java.sql.SQLException
auth - authorizer
java.sql.SQLException - When the return value of the sqlite3_set_authorizer() function is not SQLITE_OK.
public void clearAuthorizer()
throws java.sql.SQLException
java.sql.SQLException - When the return value of the sqlite3_set_authorizer() function is not SQLITE_OK.
public void setBusyHandler(BusyHandler busy)
throws java.sql.SQLException
busy - busy handler
java.sql.SQLException - When the return value of the sqlite3_busy_handler() function is not SQLITE_OK.
public void clearBusyHandler()
throws java.sql.SQLException
java.sql.SQLException - When the return value of the sqlite3_busy_handler() function is not SQLITE_OK.
public void setCollationNeededHandler(CollationNeededHandler needed)
throws java.sql.SQLException
needed - the CollationNeededHandler object
java.sql.SQLException - When the return value of the sqlite3_collation_needed() function is not SQLITE_OK.
public void clearCollationNeededHandler()
throws java.sql.SQLException
java.sql.SQLException - When the return value of the sqlite3_collation_needed() function is not SQLITE_OK.public void setProgressHandler(ProgressHandler prog)
prog - progress handlerpublic void clearProgressHandler()
public void setCommitHook(CommitHook hook)
hook - commit hootpublic void clearCommitHook()
public void setRollbackHook(RollbackHook hook)
hook - rollback hootpublic void clearRollbackHook()
public void setUpdateHook(UpdateHook hook)
hook - update hootpublic void clearUpdateHook()
public void setProfiler(Profiler profiler)
profiler - profilerpublic void clearProfiler()
public void setTracer(Tracer tracer)
tracer - tracerpublic void clearTracer()
public void enableSharedCache()
throws java.sql.SQLException
java.sql.SQLException - When the return value of the sqlite3_enable_shared_cache() function is not SQLITE_OK.
public void disableSharedCache()
throws java.sql.SQLException
java.sql.SQLException - When the return value of the sqlite3_enable_shared_cache() function is not SQLITE_OK.public int getLastError()
public java.lang.String getLastErrorMessage()
public java.util.List<java.lang.String[]> getTable(java.lang.String sql,
SWIGTYPE_p_p_char errmsg)
throws java.sql.SQLException
sql - SQL to be evaluatederrmsg - Error message written here
java.sql.SQLException - When the return value of the sqlite3_get_table() function is not SQLITE_OK.
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||