public class DBConfiguration extends java.lang.Object implements ConfigurationIF
| Modifier and Type | Class and Description |
|---|---|
protected class |
DBConfiguration.DBVar
CLass to hold varibales.
|
protected class |
DBConfiguration.VarValue
CLass to hold varibales.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DB_URL |
static java.lang.String |
ODBC_DRIVER |
| Constructor and Description |
|---|
DBConfiguration()
The default constructor.
|
DBConfiguration(java.lang.String dburl)
the constructor receiving the driver class.
|
DBConfiguration(java.lang.String driver,
java.lang.String dburl)
the constructor receiving the connection URL to database.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.sql.Connection |
getConnection()
Get a database connection
|
org.w3c.dom.Document |
getDocument()
Get the XML document, that describes the contents.
|
org.w3c.dom.Document |
getServices()
Get all available services.
|
protected java.sql.Statement |
getStatement(java.sql.Connection connection)
Get a datbase statement using the given database connection.
|
java.lang.String |
getType()
Get the type of the configuration.
|
static void |
main(java.lang.String[] args)
The main testing routine.
|
protected void |
readProducts()
read the product nodes from database.
|
protected java.util.HashMap |
readVariables(java.sql.Connection connection)
read the variables belongs to te given product and append it to the given node.
|
void |
unload()
Unload the contents.
|
public static final java.lang.String DB_URL
public static final java.lang.String ODBC_DRIVER
public DBConfiguration()
public DBConfiguration(java.lang.String dburl)
dburl - the connection URL to database.public DBConfiguration(java.lang.String driver,
java.lang.String dburl)
driver - the classname of the driver to be used.dburl - the connection URL to database.protected java.sql.Connection getConnection()
throws java.lang.Exception
an - exception if the database could not be connectted.java.lang.Exceptionprotected java.sql.Statement getStatement(java.sql.Connection connection)
protected java.util.HashMap readVariables(java.sql.Connection connection)
throws java.lang.Exception
java.lang.Exceptionprotected void readProducts()
throws java.lang.Exception
java.lang.Exceptionpublic org.w3c.dom.Document getDocument()
throws java.lang.Exception
getDocument in interface ConfigurationIFjava.lang.Exceptionpublic java.lang.String getType()
throws java.lang.Exception
getType in interface ConfigurationIFjava.lang.Exceptionpublic org.w3c.dom.Document getServices()
throws java.lang.Exception
an - exception if the connection cannot established.java.lang.Exceptionpublic void unload()
public static void main(java.lang.String[] args)
args - The runtime parameters.