public class SqlJetEngine
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected ISqlJetBtree |
btree |
protected ISqlJetDbHandle |
dbHandle |
protected java.io.File |
file |
protected static ISqlJetFileSystemsManager |
FILE_SYSTEM_MANAGER |
protected ISqlJetFileSystem |
fileSystem |
protected boolean |
open |
protected boolean |
writable |
| Constructor and Description |
|---|
SqlJetEngine(java.io.File file,
boolean writable) |
SqlJetEngine(java.io.File file,
boolean writable,
ISqlJetFileSystem fs) |
SqlJetEngine(java.io.File file,
boolean writable,
java.lang.String fsName) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTransaction(SqlJetTransactionMode mode)
Begin transaction.
|
protected void |
checkOpen() |
void |
close()
Close connection to database.
|
protected void |
closeResources() |
void |
commit()
Commits transaction.
|
protected void |
finalize() |
ISqlJetBusyHandler |
getBusyHandler()
Get busy handler.
|
int |
getCacheSize()
Get cache size (in count of pages).
|
java.io.File |
getFile() |
ISqlJetFileSystem |
getFileSystem() |
SqlJetPagerJournalMode |
getJournalMode()
Get jounrnal mode
|
ISqlJetMutex |
getMutex()
Retruns threading synchronization mutex.
|
ISqlJetOptions |
getOptions()
Returns database options.
|
SqlJetSafetyLevel |
getSafetyLevel()
Get safety level
|
protected SqlJetSchema |
getSchemaInternal() |
SqlJetTransactionMode |
getTransactionMode() |
boolean |
isInTransaction()
Returns true if a transaction is active.
|
boolean |
isOpen()
Checks is database open.
|
boolean |
isWritable()
Check write access to data base.
|
void |
open()
Opens connection to database.
|
protected void |
readSchema()
Reads database schema and options.
|
void |
refreshSchema()
Refreshes database schema.
|
void |
registerFileSystem(ISqlJetFileSystem fs,
boolean isDefault) |
void |
rollback()
Rolls back transaction.
|
protected java.lang.Object |
runEngineTransaction(ISqlJetEngineTransaction op,
SqlJetTransactionMode mode)
Runs transaction.
|
java.lang.Object |
runSynchronized(ISqlJetEngineSynchronized op) |
void |
setBusyHandler(ISqlJetBusyHandler busyHandler)
Set busy handler.
|
void |
setCacheSize(int cacheSize)
Set cache size (in count of pages).
|
void |
setJournalMode(SqlJetPagerJournalMode journalMode)
Set journal mode
|
void |
setSafetyLevel(SqlJetSafetyLevel safetyLevel)
Set safety level
|
void |
unregisterFileSystem(ISqlJetFileSystem fs) |
protected static final ISqlJetFileSystemsManager FILE_SYSTEM_MANAGER
protected ISqlJetFileSystem fileSystem
protected boolean writable
protected ISqlJetDbHandle dbHandle
protected ISqlJetBtree btree
protected boolean open
protected java.io.File file
public SqlJetEngine(java.io.File file,
boolean writable)
public SqlJetEngine(java.io.File file,
boolean writable,
ISqlJetFileSystem fs)
file - writable - fs - public SqlJetEngine(java.io.File file,
boolean writable,
java.lang.String fsName)
throws SqlJetException
file - writable - fsName - SqlJetExceptionpublic void registerFileSystem(ISqlJetFileSystem fs, boolean isDefault) throws SqlJetException
fs - isDefault - SqlJetExceptionpublic void unregisterFileSystem(ISqlJetFileSystem fs) throws SqlJetException
fs - SqlJetExceptionpublic java.io.File getFile()
public boolean isWritable()
throws SqlJetException
SqlJetExceptionpublic ISqlJetFileSystem getFileSystem()
public boolean isOpen()
protected void checkOpen()
throws SqlJetException
SqlJetExceptionpublic void open()
throws SqlJetException
Opens connection to database. It does not create any locking on database. First lock will be created when be called any method which requires real access to options or schema.
SqlJetException - if any trouble with access to file or database format.public java.lang.Object runSynchronized(ISqlJetEngineSynchronized op) throws SqlJetException
SqlJetExceptionpublic void close()
throws SqlJetException
SqlJetException - it is possible to get exception if there is actvie
transaction and rollback did not success.protected void closeResources()
throws SqlJetException
SqlJetExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwableprotected void readSchema()
throws SqlJetException
SqlJetExceptionpublic ISqlJetOptions getOptions() throws SqlJetException
SqlJetExceptionpublic void refreshSchema()
throws SqlJetException
SqlJetExceptionprotected SqlJetSchema getSchemaInternal() throws SqlJetException
SqlJetExceptionpublic ISqlJetBusyHandler getBusyHandler()
public void setBusyHandler(ISqlJetBusyHandler busyHandler)
busyHandler - the busy handler.public ISqlJetMutex getMutex()
public void setCacheSize(int cacheSize)
throws SqlJetException
cacheSize - the count of pages which can hold cache.SqlJetExceptionpublic int getCacheSize()
throws SqlJetException
SqlJetExceptionpublic void setSafetyLevel(SqlJetSafetyLevel safetyLevel) throws SqlJetException
safetyLevel - SqlJetExceptionpublic void setJournalMode(SqlJetPagerJournalMode journalMode) throws SqlJetException
journalMode - SqlJetExceptionpublic SqlJetSafetyLevel getSafetyLevel() throws SqlJetException
SqlJetExceptionpublic SqlJetPagerJournalMode getJournalMode() throws SqlJetException
SqlJetExceptionpublic boolean isInTransaction()
public SqlJetTransactionMode getTransactionMode()
public void beginTransaction(SqlJetTransactionMode mode) throws SqlJetException
mode - transaction's mode.SqlJetExceptionpublic void commit()
throws SqlJetException
SqlJetExceptionpublic void rollback()
throws SqlJetException
SqlJetExceptionprotected java.lang.Object runEngineTransaction(ISqlJetEngineTransaction op, SqlJetTransactionMode mode) throws SqlJetException
op - transaction's body (closure).mode - transaction's mode.ISqlJetTransaction.run(org.tmatesoft.sqljet.core.table.SqlJetDb)
call.SqlJetException