org.ephman.abra.database
Class DatabaseSessionFactory

java.lang.Object
  |
  +--org.ephman.abra.database.DatabaseSessionFactory

public class DatabaseSessionFactory
extends java.lang.Object

Manages creation of DatabaseSessions


Method Summary
 DatabaseSession createNewSession()
          Create a new database session
static DatabaseSessionFactory getInstance()
          Get the instance of the factory, Factory must be initalized first.
static void init(java.lang.String host, java.lang.String database, java.lang.String user, java.lang.String password, int port)
          Create the instance of the singleton object, should be called only once at initialization
static boolean initialized()
          Return true if the factory is initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createNewSession

public DatabaseSession createNewSession()
                                 throws java.sql.SQLException
Create a new database session

java.sql.SQLException

init

public static void init(java.lang.String host,
                        java.lang.String database,
                        java.lang.String user,
                        java.lang.String password,
                        int port)
                 throws java.sql.SQLException
Create the instance of the singleton object, should be called only once at initialization

Parameters:
host - host name for the database server
database - name of the database to which we are connecting
user - user id for database connection
password - password for database connection
java.sql.SQLException

getInstance

public static DatabaseSessionFactory getInstance()
                                          throws java.sql.SQLException
Get the instance of the factory, Factory must be initalized first.

java.sql.SQLException

initialized

public static boolean initialized()
Return true if the factory is initialized.