public class DBHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
closeDBs()
Used to close the database
|
org.hibernate.cfg.Configuration |
getConfiguration(DBResource resource)
Used to get the database configuration
|
static DBHelper |
getInstance()
Used to get a instance of the helper
|
java.lang.String |
getSchema(java.lang.String dialect)
Uses to get the database schema for a given dialect
|
org.hibernate.classic.Session |
getSession(DBResource resource)
Used to get the database session for a given resource
|
public static DBHelper getInstance()
public org.hibernate.classic.Session getSession(DBResource resource) throws DatabaseException
resource
- The resourceDatabaseException
- Thrown if their is a problempublic void closeDBs()
public org.hibernate.cfg.Configuration getConfiguration(DBResource resource) throws DatabaseException
resource
- The database resourceDatabaseException
- Thrown if their is a problempublic java.lang.String getSchema(java.lang.String dialect) throws DatabaseException
dialect
- The dialectDatabaseException
- Thrown if their is a problem with hibernate