org.hsqldb
Class Database
- java.lang.Object
-
- org.hsqldb.Database
-
public class Database extends java.lang.ObjectDatabase is the root class for HSQL Database Engine database.It holds the data structures that form an HSQLDB database instance.
- Since:
- 1.9.0
-
-
Field Summary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose(int closemode)Closes this Database using the specified mode.java.lang.StringgetCanonicalPath()HsqlNameManager.HsqlNamegetCatalogName()intgetDatabaseID()Returns the database ID.GranteeManagergetGranteeManager()Returns the GranteeManager for this Database.java.lang.StringgetPath()Returns the path of the databaseHsqlDatabasePropertiesgetProperties()Returns the database properties.intgetResultMaxMemoryRows()ResultgetScript(boolean indexRoots)Returns the schema and authorisation statements for the database.SessionManagergetSessionManager()Returns the SessionManager for the database.java.lang.String[]getSettingsSQL()org.hsqldb.Database.TimeoutRunnergetTimeoutRunner()java.lang.StringgetType()Returns the type of the database: "mem", "file", "res"java.lang.StringgetUniqueName()Returns a unique String identifier for the database.java.lang.StringgetURI()HsqlPropertiesgetURLProperties()UserManagergetUserManager()Returns the UserManager for this Database.booleanisFilesInJar()Is this in filesInJar mode?booleanisFilesReadOnly()Is this in filesReadOnly mode?booleanisReadOnly()booleanisReferentialIntegrity()Is referential integrity currently enforced?voidsetAvgScale(int scale)voidsetConcatNulls(boolean mode)voidsetConvertTrunc(boolean mode)voidsetDoubleNaN(boolean mode)voidsetFilesReadOnly()After this call all CACHED and TEXT tables will be set to read-only mode.voidsetIgnoreCase(boolean mode)voidsetLongVarIsLob(boolean mode)voidsetNullsFirst(boolean mode)voidsetNullsOrder(boolean mode)voidsetReadOnly()Puts this Database object in global read-only mode.voidsetReferentialIntegrity(boolean ref)Sets the isReferentialIntegrity attribute.voidsetRegularNames(boolean mode)voidsetResultMaxMemoryRows(int size)voidsetStrictColumnSize(boolean mode)voidsetStrictNames(boolean mode)voidsetStrictReferences(boolean mode)voidsetStrictTDCD(boolean mode)voidsetStrictTDCU(boolean mode)voidsetStrictTypes(boolean mode)voidsetSyntaxDb2(boolean mode)voidsetSyntaxMss(boolean mode)voidsetSyntaxMys(boolean mode)voidsetSyntaxOra(boolean mode)voidsetSyntaxPgs(boolean mode)voidsetTranslateTTI(boolean mode)voidsetUniqueName(java.lang.String name)voidsetUniqueNulls(boolean mode)
-
-
-
Field Detail
-
urlProperties
public HsqlProperties urlProperties
-
collation
public Collation collation
-
dbInfo
public DatabaseInformation dbInfo
-
logger
public Logger logger
-
sqlEnforceTypes
public boolean sqlEnforceTypes
Defaults are used in version upgrades, but overridden by databaseProperties or URL properties for new databases.
-
sqlEnforceRefs
public boolean sqlEnforceRefs
-
sqlEnforceSize
public boolean sqlEnforceSize
-
sqlEnforceNames
public boolean sqlEnforceNames
-
sqlRegularNames
public boolean sqlRegularNames
-
sqlEnforceTDCD
public boolean sqlEnforceTDCD
-
sqlEnforceTDCU
public boolean sqlEnforceTDCU
-
sqlTranslateTTI
public boolean sqlTranslateTTI
-
sqlConcatNulls
public boolean sqlConcatNulls
-
sqlUniqueNulls
public boolean sqlUniqueNulls
-
sqlNullsFirst
public boolean sqlNullsFirst
-
sqlNullsOrder
public boolean sqlNullsOrder
-
sqlConvertTruncate
public boolean sqlConvertTruncate
-
sqlAvgScale
public int sqlAvgScale
-
sqlDoubleNaN
public boolean sqlDoubleNaN
-
sqlLongvarIsLob
public boolean sqlLongvarIsLob
-
sqlIgnoreCase
public boolean sqlIgnoreCase
-
sqlSyntaxDb2
public boolean sqlSyntaxDb2
-
sqlSyntaxMss
public boolean sqlSyntaxMss
-
sqlSyntaxMys
public boolean sqlSyntaxMys
-
sqlSyntaxOra
public boolean sqlSyntaxOra
-
sqlSyntaxPgs
public boolean sqlSyntaxPgs
-
recoveryMode
public int recoveryMode
-
databaseProperties
public HsqlDatabaseProperties databaseProperties
-
userManager
public UserManager userManager
-
granteeManager
public GranteeManager granteeManager
-
nameManager
public HsqlNameManager nameManager
-
sessionManager
public SessionManager sessionManager
-
txManager
public TransactionManager txManager
-
defaultIsolationLevel
public int defaultIsolationLevel
-
txConflictRollback
public boolean txConflictRollback
-
schemaManager
public SchemaManager schemaManager
-
persistentStoreCollection
public PersistentStoreCollectionDatabase persistentStoreCollection
-
lobManager
public LobManager lobManager
-
checkpointRunner
public org.hsqldb.Database.CheckpointRunner checkpointRunner
-
timeoutRunner
public org.hsqldb.Database.TimeoutRunner timeoutRunner
-
DATABASE_ONLINE
public static final int DATABASE_ONLINE
- See Also:
- Constant Field Values
-
DATABASE_OPENING
public static final int DATABASE_OPENING
- See Also:
- Constant Field Values
-
DATABASE_CLOSING
public static final int DATABASE_CLOSING
- See Also:
- Constant Field Values
-
DATABASE_SHUTDOWN
public static final int DATABASE_SHUTDOWN
- See Also:
- Constant Field Values
-
CLOSEMODE_IMMEDIATELY
public static final int CLOSEMODE_IMMEDIATELY
- See Also:
- Constant Field Values
-
CLOSEMODE_NORMAL
public static final int CLOSEMODE_NORMAL
- See Also:
- Constant Field Values
-
CLOSEMODE_COMPACT
public static final int CLOSEMODE_COMPACT
- See Also:
- Constant Field Values
-
CLOSEMODE_SCRIPT
public static final int CLOSEMODE_SCRIPT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDatabaseID
public int getDatabaseID()
Returns the database ID.
-
getUniqueName
public java.lang.String getUniqueName()
Returns a unique String identifier for the database.
-
setUniqueName
public void setUniqueName(java.lang.String name)
-
getType
public java.lang.String getType()
Returns the type of the database: "mem", "file", "res"
-
getPath
public java.lang.String getPath()
Returns the path of the database
-
getCatalogName
public HsqlNameManager.HsqlName getCatalogName()
-
getProperties
public HsqlDatabaseProperties getProperties()
Returns the database properties.
-
getSessionManager
public SessionManager getSessionManager()
Returns the SessionManager for the database.
-
isReadOnly
public boolean isReadOnly()
-
setReadOnly
public void setReadOnly()
Puts this Database object in global read-only mode. After this call, all existing and future sessions are limited to read-only transactions. Any following attempts to update the state of the database will result in throwing an HsqlException.
-
setFilesReadOnly
public void setFilesReadOnly()
After this call all CACHED and TEXT tables will be set to read-only mode. Changes to MEMORY tables will NOT be stored or updated in the script file. This mode is intended for use with read-only media where data should not be persisted.
-
isFilesReadOnly
public boolean isFilesReadOnly()
Is this in filesReadOnly mode?
-
isFilesInJar
public boolean isFilesInJar()
Is this in filesInJar mode?
-
getUserManager
public UserManager getUserManager()
Returns the UserManager for this Database.
-
getGranteeManager
public GranteeManager getGranteeManager()
Returns the GranteeManager for this Database.
-
setReferentialIntegrity
public void setReferentialIntegrity(boolean ref)
Sets the isReferentialIntegrity attribute.
-
isReferentialIntegrity
public boolean isReferentialIntegrity()
Is referential integrity currently enforced?
-
getResultMaxMemoryRows
public int getResultMaxMemoryRows()
-
setResultMaxMemoryRows
public void setResultMaxMemoryRows(int size)
-
setStrictNames
public void setStrictNames(boolean mode)
-
setRegularNames
public void setRegularNames(boolean mode)
-
setStrictColumnSize
public void setStrictColumnSize(boolean mode)
-
setStrictReferences
public void setStrictReferences(boolean mode)
-
setStrictTypes
public void setStrictTypes(boolean mode)
-
setStrictTDCD
public void setStrictTDCD(boolean mode)
-
setStrictTDCU
public void setStrictTDCU(boolean mode)
-
setTranslateTTI
public void setTranslateTTI(boolean mode)
-
setNullsFirst
public void setNullsFirst(boolean mode)
-
setNullsOrder
public void setNullsOrder(boolean mode)
-
setConcatNulls
public void setConcatNulls(boolean mode)
-
setUniqueNulls
public void setUniqueNulls(boolean mode)
-
setConvertTrunc
public void setConvertTrunc(boolean mode)
-
setDoubleNaN
public void setDoubleNaN(boolean mode)
-
setAvgScale
public void setAvgScale(int scale)
-
setLongVarIsLob
public void setLongVarIsLob(boolean mode)
-
setIgnoreCase
public void setIgnoreCase(boolean mode)
-
setSyntaxDb2
public void setSyntaxDb2(boolean mode)
-
setSyntaxMss
public void setSyntaxMss(boolean mode)
-
setSyntaxMys
public void setSyntaxMys(boolean mode)
-
setSyntaxOra
public void setSyntaxOra(boolean mode)
-
setSyntaxPgs
public void setSyntaxPgs(boolean mode)
-
close
public void close(int closemode)
Closes this Database using the specified mode.- closemode -1 performs SHUTDOWN IMMEDIATELY, equivalent to a poweroff or crash.
- closemode 0 performs a normal SHUTDOWN that checkpoints the database normally.
- closemode 1 performs a shutdown compact that scripts out the contents of any CACHED tables to the log then deletes the existing *.data file that contains the data for all CACHED table before the normal checkpoint process which in turn creates a new, compact *.data file.
-
getSettingsSQL
public java.lang.String[] getSettingsSQL()
-
getScript
public Result getScript(boolean indexRoots)
Returns the schema and authorisation statements for the database.
-
getURI
public java.lang.String getURI()
-
getCanonicalPath
public java.lang.String getCanonicalPath()
-
getURLProperties
public HsqlProperties getURLProperties()
-
getTimeoutRunner
public org.hsqldb.Database.TimeoutRunner getTimeoutRunner()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG