public class Session extends GenericBean { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // User-defined methods //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Creates a new database access object. * * @return the new database access object * @throws Exception if the connection can not be opened */ public DBAccess getNewDBAccess() throws Exception { DBAccess dba = DBAccess.getDBAccess(DBSecurityManager.getCredentials( SessionContext.getCurrentSessionConfig())); dba.open(); return dba; } /** * Returns the access to the database. * * @return the access to the database * @throws Exception if the datasource can not be opened */ public DBAccess getDBAccess() throws Exception { DBAccess dba = (DBAccess)get("dBAccess"); if (dba == null) { dba = getNewDBAccess(); put("dBAccess", dba); } return dba; } /** * Gets the user registration business object. * * @return the business object for user registrations */ public UserRegistration getRegistration() { UserRegistration ureg = (UserRegistration)get("registration"); if (ureg == null) { ureg = new UserRegistration(); put("registration", ureg); } return ureg; } } // Session