cgl.narada.service.storage.db
Class DatabaseFactory

java.lang.Object
  extended by cgl.narada.service.storage.db.DatabaseFactory

public class DatabaseFactory
extends Object

Title: DatabaseFactory

Description: Creates a static instance of DataAccessObject to do task on database

Version:
1.0

Constructor Summary
DatabaseFactory()
           
 
Method Summary
 void createDAO()
          creates new instance of DataAccessObject by getting username and password from UserConfigure file
 void createDAO(String driver, String conInfo, String uname, String password)
          creates new instance of DataAccessObject
 String getConnnectionInfo(String[] param)
          composes connection information variable
 DataAccessObject getDAO()
           
 Properties getProperties()
           
 void loadProperties(String[] connectParameters)
          loads parameters to connect database
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseFactory

public DatabaseFactory()
Method Detail

getConnnectionInfo

public String getConnnectionInfo(String[] param)
composes connection information variable

Parameters:
param - array of parameters

createDAO

public void createDAO()
creates new instance of DataAccessObject by getting username and password from UserConfigure file


createDAO

public void createDAO(String driver,
                      String conInfo,
                      String uname,
                      String password)
               throws ServiceException
creates new instance of DataAccessObject

Parameters:
driver - database driver
conInfo - connection information for database
uname - database username
password - database user password
Throws:
ServiceException

getDAO

public DataAccessObject getDAO()
                        throws ServiceException
Returns:
DataAccessObject if it is null it creates new one and sets it to the static variable of this object
Throws:
ServiceException

getProperties

public Properties getProperties()
                         throws Exception
Returns:
Properties for a given file
Throws:
Exception

loadProperties

public void loadProperties(String[] connectParameters)
                    throws Exception
loads parameters to connect database

Parameters:
connectParameters - parameter rewired for connection
Throws:
Exception

main

public static void main(String[] args)


For comments and suggestions please send e-mail to The NaradaBrokering Project