public class ConnectionConfiguration extends Object
Constructor and Description |
---|
ConnectionConfiguration(Class<?> targetClass)
Set propertyFile either with the location get from system property or the
default location next to the db instance.
|
ConnectionConfiguration(String dbClassname)
Set propertyFile either with the location get from system property or the
default location next to the db instance.
|
ConnectionConfiguration(String dbClassname,
String defaultFilePath)
Set propertyFile either with the location get from system property or the
default location next to the db instance.
|
Modifier and Type | Method and Description |
---|---|
void |
deletePropertyFile()
Delete the propertyFile.
|
Boolean |
getBoolean(String key) |
String |
getCatalog() |
EncryptedPassword |
getEncryptedPassword(String key) |
String |
getHost() |
Integer |
getInteger(String key) |
int |
getMaxStatementsPerConnection() |
Password |
getPassword() |
int |
getPort()
Return port number.
|
Hashtable<Object,Object> |
getProperties()
Returns all properties.
|
String |
getString(String key) |
String |
getUrlExtension() |
String |
getUsername()
Return username.
|
boolean |
isServerDataSource()
Return isServerDataSource.
|
void |
storeProperties(Map<String,String> propertiesMap)
Set and store properties.
|
void |
storeProperties(Map<String,String> propertiesMap,
String xmlEncoding)
Set and store properties.
|
void |
storeProperty(String key,
String value)
Set and store property.
|
void |
storeProperty(String key,
String value,
String xmlEncoding)
Set and store property.
|
public ConnectionConfiguration(String dbClassname)
(dbClassname + "_config.properties")
or
(dbClassname + "_config.xml")
.dbClassname
- name of the database instancepublic ConnectionConfiguration(String dbClassname, String defaultFilePath)
(dbClassname + "_config.properties")
.dbClassname
- classname of the database instancedefaultFilePath
- path to defaultFile without filenamepublic ConnectionConfiguration(Class<?> targetClass)
(dbClassname + "_config.properties")
.targetClass
- class where the default properties file have to be locatedpublic void storeProperty(String key, String value, String xmlEncoding) throws IOException
key
- , name of valuevalue
- , property valuexmlEncoding
- , encoding for the xml property fileIOException
- , Can not load properties filepublic void storeProperties(Map<String,String> propertiesMap, String xmlEncoding) throws IOException
propertiesMap
- with propertiesxmlEncoding
- , encoding for the xml property fileIOException
- , Can not load properties filepublic void storeProperty(String key, String value) throws IOException
key
- , name of valuevalue
- , property valueIOException
- , Can not load properties filepublic void storeProperties(Map<String,String> propertiesMap) throws IOException
propertiesMap
- with propertiesIOException
- , Can not load properties filepublic void deletePropertyFile()
public String getString(String key) throws FileNotFoundException, IOException
key
- to String valueFileNotFoundException
- , Can not found file, Can not found fileIOException
- , Can not load properties file, Can not load properties file
Can not load properties filepublic Integer getInteger(String key) throws FileNotFoundException, IOException
key
- to Integer valueFileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic Boolean getBoolean(String key) throws FileNotFoundException, IOException
key
- to boolean valueFileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic EncryptedPassword getEncryptedPassword(String key) throws FileNotFoundException, IOException
key
- to password valueFileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic String getHost() throws FileNotFoundException, IOException
FileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic int getPort() throws FileNotFoundException, IOException
FileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic String getUsername() throws FileNotFoundException, IOException
FileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic Password getPassword() throws FileNotFoundException, IOException
FileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic String getCatalog() throws FileNotFoundException, IOException
FileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic String getUrlExtension() throws FileNotFoundException, IOException
FileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic boolean isServerDataSource() throws FileNotFoundException, IOException
FileNotFoundException
- , Can not found fileIOException
- , Can not load properties filepublic int getMaxStatementsPerConnection()
public Hashtable<Object,Object> getProperties() throws FileNotFoundException, IOException
FileNotFoundException
- , Can not found fileIOException
- , Can not load properties fileCopyright © 2003–2021 XDEV Software. All rights reserved.