Package com.mckoi.database.control
Class DefaultDBConfig
java.lang.Object
com.mckoi.database.control.AbstractDBConfig
com.mckoi.database.control.DefaultDBConfig
- All Implemented Interfaces:
DBConfig
Implements a default database configuration that is useful for setting up
a database. This configuration object is mutable. Configuration properties
can be set by calling the 'setxxx' methods.
- Author:
- Tobias Downer
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the configuration with the current system path as the configuration path.DefaultDBConfig
(File current_path) Constructs the configuration. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getDefaultValue
(String property_key) Gets the default value for the given property value.void
loadFromFile
(File configuration_file) Loads all the configuration settings from a configuration file.void
loadFromStream
(InputStream input) Loads all the configuration values from the given InputStream.void
loadFromURL
(URL configuration_url) Loads all the configuration values from the given URL.void
setDatabasePath
(String path) Sets the path of the database.void
setIgnoreIdentifierCase
(boolean status) Sets that the engine ignores case for identifiers.void
setLogPath
(String path) Sets the path of the log.void
setMinimumDebugLevel
(int debug_level) Sets the minimum debug level for output to the debug log file.void
setReadOnly
(boolean status) Sets that the database is read only.void
Overwrites the configuration key with the given value.Methods inherited from class com.mckoi.database.control.AbstractDBConfig
currentPath, getValue, immutableCopy
-
Constructor Details
-
DefaultDBConfig
Constructs the configuration.- Parameters:
the
- current path of the configuration in the file system. This is useful if the configuration is based on a file with relative paths set in it.
-
DefaultDBConfig
public DefaultDBConfig()Constructs the configuration with the current system path as the configuration path.
-
-
Method Details
-
getDefaultValue
Gets the default value for the given property value.- Overrides:
getDefaultValue
in classAbstractDBConfig
-
setValue
Overwrites the configuration key with the given value.- Overrides:
setValue
in classAbstractDBConfig
-
loadFromStream
Loads all the configuration values from the given InputStream. The input stream must be formatted in a standard properties format.- Throws:
IOException
-
loadFromFile
Loads all the configuration settings from a configuration file. Useful if you want to load a default configuration from a 'db.conf' file. The file must be formatted in a standard properties format.- Throws:
IOException
-
loadFromURL
Loads all the configuration values from the given URL. The file must be formatted in a standard properties format.- Throws:
IOException
-
setDatabasePath
Sets the path of the database. -
setLogPath
Sets the path of the log. -
setIgnoreIdentifierCase
public void setIgnoreIdentifierCase(boolean status) Sets that the engine ignores case for identifiers. -
setReadOnly
public void setReadOnly(boolean status) Sets that the database is read only. -
setMinimumDebugLevel
public void setMinimumDebugLevel(int debug_level) Sets the minimum debug level for output to the debug log file.
-