| java.lang.Object net.jforum.DBConnection
All known Subclasses: net.jforum.C3P0PooledConnection, net.jforum.SimpleConnection, net.jforum.DataSourceConnection,
DBConnection | abstract public class DBConnection (Code) | | Base class for all database connection implementations that
may be used with JForum.
Default implementations are PooledConnection , which
is the defeault connection pool implementation, and SimpleConnection ,
which opens a new connection on every request.
author: Rafael Steil version: $Id: DBConnection.java,v 1.14 2006/08/23 02:24:06 rafaelsteil Exp $ |
isDatabaseUp | protected boolean isDatabaseUp(Code) | | |
createInstance | public static boolean createInstance()(Code) | | Creates an instance of some DBConnection implementation.
true if the instance was successfully created, or false if some exception was thrown. |
getConnection | abstract public Connection getConnection()(Code) | | Gets a connection.
Connection pools' normal behaviour will be to once connection
from the pool, while non-pooled implementations will want to
go to the database and get the connection in time the method
is called.
Connection |
getImplementation | public static DBConnection getImplementation()(Code) | | Gets the current DBConnection implementation's instance
DBConnection |
init | abstract public void init() throws Exception(Code) | | Inits the implementation.
Connection pools may use this method to init the connections from the
database, while non-pooled implementation can provide an empty method
block if no other initialization is necessary.
Please note that this method will be called just once, at system startup.
throws: Exception - |
isDatabaseUp | public boolean isDatabaseUp()(Code) | | Checks if database connection is up.
true if a connection to the databasewas successfully created, or false if not. |
realReleaseAllConnections | abstract public void realReleaseAllConnections() throws Exception(Code) | | Close all open connections.
throws: Exception - |
releaseConnection | abstract public void releaseConnection(Connection conn)(Code) | | Releases a connection.
Connection pools will want to put the connection back to the pool list,
while non-pooled implementations should call close() directly
in the connection object.
Parameters: conn - The connection to release |
|
|