org.tmatesoft.sqljet.core.internal.table
Class SqlJetOptions

java.lang.Object
  extended by org.tmatesoft.sqljet.core.internal.table.SqlJetOptions
All Implemented Interfaces:
ISqlJetOptions

public class SqlJetOptions
extends java.lang.Object
implements ISqlJetOptions


Field Summary
 
Fields inherited from interface org.tmatesoft.sqljet.core.table.ISqlJetOptions
SQLJET_DEFAULT_ENCODING, SQLJET_DEFAULT_ENCODING_PROPERTY, SQLJET_DEFAULT_FILE_FORMAT, SQLJET_DEFAULT_FILE_FORMAT_PROPERTY, SQLJET_LEGACY_FILE_FORMAT, SQLJET_LEGACY_FILE_FORMAT_PROPERTY
 
Constructor Summary
SqlJetOptions(ISqlJetBtree btree, ISqlJetDbHandle dbHandle)
           
 
Method Summary
 void changeSchemaVersion()
          Change SchemaCookie.
 int getCacheSize()
          Size of the page cache.
 SqlJetEncoding getEncoding()
          Db text encoding.
 int getFileFormat()
          File format of schema layer.
 int getSchemaVersion()
          Schema cookie.
 int getUserVersion()
          The user cookie.
 boolean isAutovacuum()
          Use freelist if false.
 boolean isIncrementalVacuum()
          Incremental-vacuum flag.
 boolean isLegacyFileFormat()
          Checks if legacy file format is used for the new databases.
 void setAutovacuum(boolean autovacuum)
          Set autovacuum flag.
 void setCacheSize(int pageCacheSize)
          Set page cache's size.
 void setEncoding(SqlJetEncoding encoding)
          Set encoding.
 void setFileFormat(int fileFormat)
          Set file format.
 void setIncrementalVacuum(boolean incrementalVacuum)
          Set incremental vacuum flag.
 void setLegacyFileFormat(boolean flag)
          Instructs SQLJet to use legacy file format for all new databases.
 void setSchemaVersion(int version)
          Set schema version.
 void setUserVersion(int userCookie)
          Set user's cookie.
 java.lang.String toString()
           
 boolean verifySchemaVersion(boolean throwIfStale)
          Verify schema cookie and return true if it is unchanged by other process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SqlJetOptions

public SqlJetOptions(ISqlJetBtree btree,
                     ISqlJetDbHandle dbHandle)
              throws SqlJetException
Throws:
SqlJetException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSchemaVersion

public int getSchemaVersion()
                     throws SqlJetException
Description copied from interface: ISqlJetOptions
Schema cookie. Changes with each schema change.

Specified by:
getSchemaVersion in interface ISqlJetOptions
Returns:
the schemaCookie
Throws:
SqlJetException

getFileFormat

public int getFileFormat()
                  throws SqlJetException
Description copied from interface: ISqlJetOptions
File format of schema layer.

Specified by:
getFileFormat in interface ISqlJetOptions
Returns:
the fileFormat
Throws:
SqlJetException

getCacheSize

public int getCacheSize()
                 throws SqlJetException
Description copied from interface: ISqlJetOptions
Size of the page cache.

Specified by:
getCacheSize in interface ISqlJetOptions
Returns:
the pageCacheSize
Throws:
SqlJetException

isAutovacuum

public boolean isAutovacuum()
                     throws SqlJetException
Description copied from interface: ISqlJetOptions
Use freelist if false. Autovacuum if true.

Specified by:
isAutovacuum in interface ISqlJetOptions
Returns:
the autovacuum
Throws:
SqlJetException

getEncoding

public SqlJetEncoding getEncoding()
                           throws SqlJetException
Description copied from interface: ISqlJetOptions
Db text encoding.

Specified by:
getEncoding in interface ISqlJetOptions
Returns:
the encoding
Throws:
SqlJetException

isLegacyFileFormat

public boolean isLegacyFileFormat()
                           throws SqlJetException
Description copied from interface: ISqlJetOptions
Checks if legacy file format is used for the new databases.

Specified by:
isLegacyFileFormat in interface ISqlJetOptions
Throws:
SqlJetException

setLegacyFileFormat

public void setLegacyFileFormat(boolean flag)
                         throws SqlJetException
Description copied from interface: ISqlJetOptions
Instructs SQLJet to use legacy file format for all new databases.

Specified by:
setLegacyFileFormat in interface ISqlJetOptions
Throws:
SqlJetException

getUserVersion

public int getUserVersion()
                   throws SqlJetException
Description copied from interface: ISqlJetOptions
The user cookie. Used by the application.

Specified by:
getUserVersion in interface ISqlJetOptions
Returns:
the userCookie
Throws:
SqlJetException

isIncrementalVacuum

public boolean isIncrementalVacuum()
                            throws SqlJetException
Description copied from interface: ISqlJetOptions
Incremental-vacuum flag.

Specified by:
isIncrementalVacuum in interface ISqlJetOptions
Returns:
the incrementalVacuum
Throws:
SqlJetException

setSchemaVersion

public void setSchemaVersion(int version)
                      throws SqlJetException
Description copied from interface: ISqlJetOptions
Set schema version. It can be performed only in active transaction.

Specified by:
setSchemaVersion in interface ISqlJetOptions
Throws:
SqlJetException

verifySchemaVersion

public boolean verifySchemaVersion(boolean throwIfStale)
                            throws SqlJetException
Description copied from interface: ISqlJetOptions
Verify schema cookie and return true if it is unchanged by other process. If throwIfStale is true then throw exception if cookie is changed by other process.

Specified by:
verifySchemaVersion in interface ISqlJetOptions
Returns:
true of schema has not been changed
Throws:
SqlJetException

changeSchemaVersion

public void changeSchemaVersion()
                         throws SqlJetException
Description copied from interface: ISqlJetOptions
Change SchemaCookie. It can be performed only in active transaction

Specified by:
changeSchemaVersion in interface ISqlJetOptions
Throws:
SqlJetException

setUserVersion

public void setUserVersion(int userCookie)
                    throws SqlJetException
Description copied from interface: ISqlJetOptions
Set user's cookie. It can be performed only in active transaction.

Specified by:
setUserVersion in interface ISqlJetOptions
Throws:
SqlJetException

setFileFormat

public void setFileFormat(int fileFormat)
                   throws SqlJetException
Description copied from interface: ISqlJetOptions
Set file format. It's allowed only on new empty data base. It can't be performed in active transaction.

Specified by:
setFileFormat in interface ISqlJetOptions
Throws:
SqlJetException

setCacheSize

public void setCacheSize(int pageCacheSize)
                  throws SqlJetException
Description copied from interface: ISqlJetOptions
Set page cache's size. It can be performed only in active transaction.

Specified by:
setCacheSize in interface ISqlJetOptions
Throws:
SqlJetException

setAutovacuum

public void setAutovacuum(boolean autovacuum)
                   throws SqlJetException
Description copied from interface: ISqlJetOptions
Set autovacuum flag. It's allowed only on new empty data base. It can't be performed in active transaction.

Specified by:
setAutovacuum in interface ISqlJetOptions
Throws:
SqlJetException

setEncoding

public void setEncoding(SqlJetEncoding encoding)
                 throws SqlJetException
Description copied from interface: ISqlJetOptions
Set encoding. It's allowed only on new empty data base. It can't be performed in active transaction.

Specified by:
setEncoding in interface ISqlJetOptions
Throws:
SqlJetException

setIncrementalVacuum

public void setIncrementalVacuum(boolean incrementalVacuum)
                          throws SqlJetException
Description copied from interface: ISqlJetOptions
Set incremental vacuum flag. It's allowed only on new empty data base. It can't be performed in active transaction.

Specified by:
setIncrementalVacuum in interface ISqlJetOptions
Throws:
SqlJetException