Class SqlJetOptions
- java.lang.Object
-
- 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
Constructors Constructor Description SqlJetOptions(ISqlJetBtree btree, ISqlJetDbHandle dbHandle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeSchemaVersion()Change SchemaCookie.intgetCacheSize()Size of the page cache.SqlJetEncodinggetEncoding()Db text encoding.intgetFileFormat()File format of schema layer.intgetSchemaVersion()Schema cookie.intgetUserVersion()The user cookie.booleanisAutovacuum()Use freelist if false.booleanisIncrementalVacuum()Incremental-vacuum flag.booleanisLegacyFileFormat()Checks if legacy file format is used for the new databases.voidsetAutovacuum(boolean autovacuum)Set autovacuum flag.voidsetCacheSize(int pageCacheSize)Set page cache's size.voidsetEncoding(SqlJetEncoding encoding)Set encoding.voidsetFileFormat(int fileFormat)Set file format.voidsetIncrementalVacuum(boolean incrementalVacuum)Set incremental vacuum flag.voidsetLegacyFileFormat(boolean flag)Instructs SQLJet to use legacy file format for all new databases.voidsetSchemaVersion(int version)Set schema version.voidsetUserVersion(int userCookie)Set user's cookie.java.lang.StringtoString()booleanverifySchemaVersion(boolean throwIfStale)Verify schema cookie and return true if it is unchanged by other process.
-
-
-
Constructor Detail
-
SqlJetOptions
public SqlJetOptions(ISqlJetBtree btree, ISqlJetDbHandle dbHandle) throws SqlJetException
- Throws:
SqlJetException
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSchemaVersion
public int getSchemaVersion() throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsSchema cookie. Changes with each schema change.- Specified by:
getSchemaVersionin interfaceISqlJetOptions- Returns:
- the schemaCookie
- Throws:
SqlJetException
-
getFileFormat
public int getFileFormat() throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsFile format of schema layer.- Specified by:
getFileFormatin interfaceISqlJetOptions- Returns:
- the fileFormat
- Throws:
SqlJetException
-
getCacheSize
public int getCacheSize() throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsSize of the page cache.- Specified by:
getCacheSizein interfaceISqlJetOptions- Returns:
- the pageCacheSize
- Throws:
SqlJetException
-
isAutovacuum
public boolean isAutovacuum() throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsUse freelist if false. Autovacuum if true.- Specified by:
isAutovacuumin interfaceISqlJetOptions- Returns:
- the autovacuum
- Throws:
SqlJetException
-
getEncoding
public SqlJetEncoding getEncoding() throws SqlJetException
Description copied from interface:ISqlJetOptionsDb text encoding.- Specified by:
getEncodingin interfaceISqlJetOptions- Returns:
- the encoding
- Throws:
SqlJetException
-
isLegacyFileFormat
public boolean isLegacyFileFormat() throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsChecks if legacy file format is used for the new databases.- Specified by:
isLegacyFileFormatin interfaceISqlJetOptions- Throws:
SqlJetException
-
setLegacyFileFormat
public void setLegacyFileFormat(boolean flag) throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsInstructs SQLJet to use legacy file format for all new databases.- Specified by:
setLegacyFileFormatin interfaceISqlJetOptions- Throws:
SqlJetException
-
getUserVersion
public int getUserVersion() throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsThe user cookie. Used by the application.- Specified by:
getUserVersionin interfaceISqlJetOptions- Returns:
- the userCookie
- Throws:
SqlJetException
-
isIncrementalVacuum
public boolean isIncrementalVacuum() throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsIncremental-vacuum flag.- Specified by:
isIncrementalVacuumin interfaceISqlJetOptions- Returns:
- the incrementalVacuum
- Throws:
SqlJetException
-
setSchemaVersion
public void setSchemaVersion(int version) throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsSet schema version. It can be performed only in active transaction.- Specified by:
setSchemaVersionin interfaceISqlJetOptions- Throws:
SqlJetException
-
verifySchemaVersion
public boolean verifySchemaVersion(boolean throwIfStale) throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsVerify 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:
verifySchemaVersionin interfaceISqlJetOptions- Returns:
- true of schema has not been changed
- Throws:
SqlJetException
-
changeSchemaVersion
public void changeSchemaVersion() throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsChange SchemaCookie. It can be performed only in active transaction- Specified by:
changeSchemaVersionin interfaceISqlJetOptions- Throws:
SqlJetException
-
setUserVersion
public void setUserVersion(int userCookie) throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsSet user's cookie. It can be performed only in active transaction.- Specified by:
setUserVersionin interfaceISqlJetOptions- Throws:
SqlJetException
-
setFileFormat
public void setFileFormat(int fileFormat) throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsSet file format. It's allowed only on new empty data base. It can't be performed in active transaction.- Specified by:
setFileFormatin interfaceISqlJetOptions- Throws:
SqlJetException
-
setCacheSize
public void setCacheSize(int pageCacheSize) throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsSet page cache's size. It can be performed only in active transaction.- Specified by:
setCacheSizein interfaceISqlJetOptions- Throws:
SqlJetException
-
setAutovacuum
public void setAutovacuum(boolean autovacuum) throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsSet autovacuum flag. It's allowed only on new empty data base. It can't be performed in active transaction.- Specified by:
setAutovacuumin interfaceISqlJetOptions- Throws:
SqlJetException
-
setEncoding
public void setEncoding(SqlJetEncoding encoding) throws SqlJetException
Description copied from interface:ISqlJetOptionsSet encoding. It's allowed only on new empty data base. It can't be performed in active transaction.- Specified by:
setEncodingin interfaceISqlJetOptions- Throws:
SqlJetException
-
setIncrementalVacuum
public void setIncrementalVacuum(boolean incrementalVacuum) throws SqlJetExceptionDescription copied from interface:ISqlJetOptionsSet incremental vacuum flag. It's allowed only on new empty data base. It can't be performed in active transaction.- Specified by:
setIncrementalVacuumin interfaceISqlJetOptions- Throws:
SqlJetException
-
-