org.openmobileis.common.util.database.JdbcPoolManagerDB Class Reference

Inheritance diagram for org.openmobileis.common.util.database.JdbcPoolManagerDB:

org.openmobileis.common.util.database.ManagerDB List of all members.

Detailed Description

Title: OpenMobileIS project source
Description: This class represents the manager for the SGBDR .

It allows to connect a database by giving an url and a jdbc driver It establishes the connection, prepare statement and manage the application queries (using pool connections) All the DB parameters are contained in the database.properties file which is read by the InitFactories class.

Author:
Philippe Delrieu
Since:
JDK 1.1
Version:
1.0.

Definition at line 53 of file JdbcPoolManagerDB.java.

Public Member Functions

 JdbcPoolManagerDB ()
 * Connect to the database
 JdbcPoolManagerDB (String alias, String srvdriver, String dbserver, String srvlogin, String srvpassword, int monitorinterval, int maxconnection, int idltimeout, int checkouttimeout, int maxcheckout, String shutdownquery)
void connect () throws ServiceException
void disconnect ()
 disconnect() method allows to close the database
boolean isConnected ()
Connection getConnection () throws java.sql.SQLException
 getConnection() return a free connection or null if all the connections are used after a given time out
void garbageOpenedConnection ()


Constructor & Destructor Documentation

org.openmobileis.common.util.database.JdbcPoolManagerDB.JdbcPoolManagerDB (  ) 

* Connect to the database

Parameters:
monitor interval : how many seconds to wait between reaping connections in the pool.
String driver : jdbc driver bridge (ex: "com.imaginary.sql.msql.MsqlDriver")
String server url : Name of the database "jdbc:msql:databaseName"
String login
String password
int maximum available connections
idle timeout : seconds a connection can be idle before it is closed
int checkout timeout : seconds a connection can be checked out by a thread before it is returned back to the pool
int maxCheckout : number of times a connection can be re-used before connection to database is closed and re-opened
String shutdown query called before closing database. For instance, hsql need to query "shutdown compact" explicitly before closing (can be null)
Returns:
None
Exceptions:
IOException for log file
Exception : Impossible to find the database or to find the driver

Definition at line 88 of file JdbcPoolManagerDB.java.


Member Function Documentation

void org.openmobileis.common.util.database.JdbcPoolManagerDB.disconnect (  )  [virtual]

disconnect() method allows to close the database

Parameters:
None 
Returns:
None
Exceptions:
SQLException 

Implements org.openmobileis.common.util.database.ManagerDB.

Definition at line 163 of file JdbcPoolManagerDB.java.

Connection org.openmobileis.common.util.database.JdbcPoolManagerDB.getConnection (  )  throws java.sql.SQLException [virtual]

getConnection() return a free connection or null if all the connections are used after a given time out

Parameters:
: None
Returns:
: Connection
Exceptions:
: None

Implements org.openmobileis.common.util.database.ManagerDB.

Definition at line 208 of file JdbcPoolManagerDB.java.

References org.openmobileis.common.util.database.JdbcPoolManagerDB.isConnected().


The documentation for this class was generated from the following file:
Generated on Mon Dec 4 11:03:34 2006 for OpenMobileIS by  doxygen 1.5.1-p1