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 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.
-
-
-
Constructor Detail
-
SqlJetOptions
public SqlJetOptions(ISqlJetBtree btree, ISqlJetDbHandle dbHandle) throws SqlJetException
- Throws:
SqlJetException
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSchemaVersion
public int getSchemaVersion() throws SqlJetException
Description copied from interface:ISqlJetOptions
Schema cookie. Changes with each schema change.- Specified by:
getSchemaVersion
in interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- Returns:
- the autovacuum
- Throws:
SqlJetException
-
getEncoding
public SqlJetEncoding getEncoding() throws SqlJetException
Description copied from interface:ISqlJetOptions
Db text encoding.- Specified by:
getEncoding
in interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- Throws:
SqlJetException
-
getUserVersion
public int getUserVersion() throws SqlJetException
Description copied from interface:ISqlJetOptions
The user cookie. Used by the application.- Specified by:
getUserVersion
in interfaceISqlJetOptions
- Returns:
- the userCookie
- Throws:
SqlJetException
-
isIncrementalVacuum
public boolean isIncrementalVacuum() throws SqlJetException
Description copied from interface:ISqlJetOptions
Incremental-vacuum flag.- Specified by:
isIncrementalVacuum
in interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- 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 interfaceISqlJetOptions
- Throws:
SqlJetException
-
-