|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.services.db.TurbineDB
This class provides a common front end to all database - related
services in Turbine. Currently these are PoolBrokerService
and
MapBrokerService
. This class contains static methods that you
can call to access the methods of system's configured service
implementations.
This class is deprecated you should use org.apache.torque.Torque Connection dbConn = null; try { dbConn = Torque.getConnection(); // Do something with the connection here... } catch (Exception e) { // Either from obtaining the connection or from your application code. } finally { try { dbConn.close(); } catch (Exception e) { // Error releasing database connection back to pool. } }
Constructor Summary | |
TurbineDB()
Deprecated. |
Method Summary | |
static java.sql.Connection |
getConnection()
Deprecated. This method returns a DBConnection from the default pool. |
static java.sql.Connection |
getConnection(java.lang.String name)
Deprecated. This method returns a DBConnection from the pool with the specified name. |
static org.apache.torque.map.DatabaseMap |
getDatabaseMap()
Deprecated. Returns the default database map information. |
static org.apache.torque.map.DatabaseMap |
getDatabaseMap(java.lang.String name)
Deprecated. Returns the database map information. |
static org.apache.torque.adapter.DB |
getDB()
Deprecated. Returns the database adapter for the default connection pool. |
static org.apache.torque.adapter.DB |
getDB(java.lang.String name)
Deprecated. Returns database adapter for a specific connection pool. |
static java.lang.String |
getDefaultDB()
Deprecated. Returns the pool name for the default database. |
static java.lang.String |
getDefaultMap()
Deprecated. Returns the map name for the default database. |
static void |
releaseConnection(java.sql.Connection dbconn)
Deprecated. Release a connection back to the database pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TurbineDB()
Method Detail |
public static java.lang.String getDefaultMap()
public static org.apache.torque.map.DatabaseMap getDatabaseMap() throws TurbineException
TurbineException
- Any exceptions caught during processing will be
rethrown wrapped into a TurbineException.public static org.apache.torque.map.DatabaseMap getDatabaseMap(java.lang.String name) throws TurbineException
name
- The name of the DatabaseMap
to
retrieve.DatabaseMap
.TurbineException
- Any exceptions caught during processing will be
rethrown wrapped into a TurbineException.public static java.lang.String getDefaultDB()
public static java.sql.Connection getConnection() throws java.lang.Exception
java.lang.Exception
- Any exceptions caught during processing will be
rethrown wrapped into a TurbineException.public static java.sql.Connection getConnection(java.lang.String name) throws java.lang.Exception
#registerPool(String,String,String,String,String)
method, or be specified in the property file using the
following syntax:
database.[name].driver database.[name].url database.[name].username database.[name].password
name
- The name of the pool to get a connection from.java.lang.Exception
- Any exceptions caught during processing will be
rethrown wrapped into a TurbineException.public static void releaseConnection(java.sql.Connection dbconn) throws java.lang.Exception
TurbineException
- Any exceptions caught during processing will be
rethrown wrapped into a TurbineException.java.lang.Exception
- A generic exception.public static org.apache.torque.adapter.DB getDB() throws java.lang.Exception
java.lang.Exception
- Any exceptions caught during processing will be
rethrown wrapped into a TurbineException.public static org.apache.torque.adapter.DB getDB(java.lang.String name) throws java.lang.Exception
name
- A pool name.java.lang.Exception
- Any exceptions caught during processing will be
rethrown wrapped into a TurbineException.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |