es.iac.ing.codeso.gen
Class DbAccess

java.lang.Object
  extended by es.iac.ing.codeso.gen.DbAccess

public class DbAccess
extends java.lang.Object

Provides a means of retrieving a set of configurations from a database.


Nested Class Summary
static class DbAccess.DbAccessException
          Describes all exceptions generated by the DbAccess class.
 
Constructor Summary
DbAccess()
          Constructs a new database access object
DbAccess(java.lang.String dbSourceUrl, java.lang.String dbUser, java.lang.String dbPassword)
          Constructs a new database access object to access the specified resource.
 
Method Summary
 void close()
          Closes down the database in an orderly way and frees up any associated resources.
 java.sql.ResultSet executeSqlQuery(java.lang.String sqlQuery)
          Retrieves a resultset based on the supplied query.
 java.util.LinkedHashMap<java.lang.String,java.lang.String> readSubSystemConfigurationData(java.lang.String tableName)
          Given the name of the appropriate table, retrieves a hashtable containing all the configurations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbAccess

public DbAccess()
         throws DbAccess.DbAccessException
Constructs a new database access object

Throws:
DbAccess.DbAccessException - if some problem occurs.

DbAccess

public DbAccess(java.lang.String dbSourceUrl,
                java.lang.String dbUser,
                java.lang.String dbPassword)
         throws DbAccess.DbAccessException
Constructs a new database access object to access the specified resource.

Parameters:
dbSourceUrl - String specifying the URL of the database to connect to.
dbUser - String specifying the user name to be used for the connection.
dbPassword - String specifying the password to be used for the connection.
Throws:
DbAccess.DbAccessException - if some problem occurs.
Method Detail

readSubSystemConfigurationData

public java.util.LinkedHashMap<java.lang.String,java.lang.String> readSubSystemConfigurationData(java.lang.String tableName)
                                                                                          throws DbAccess.DbAccessException
Given the name of the appropriate table, retrieves a hashtable containing all the configurations.

Parameters:
tableName - name of database table
Returns:
LinkedHashMap table of keys and properties
Throws:
DbAccess.DbAccessException - if some access error occurred

executeSqlQuery

public java.sql.ResultSet executeSqlQuery(java.lang.String sqlQuery)
                                   throws DbAccess.DbAccessException
Retrieves a resultset based on the supplied query.

Parameters:
sqlQuery - String specifying the SQL query to be executed
Returns:
ResultSet the results of the query
Throws:
DbAccess.DbAccessException - if some access error occurred

close

public void close()
Closes down the database in an orderly way and frees up any associated resources.

It is the responsibility of users to ensure that this method is called once database access is no longer required.