org.openmobileis.common.util.database
Class JdbcPoolManagerDB

java.lang.Object
  extended byorg.openmobileis.common.util.database.ManagerDB
      extended byorg.openmobileis.common.util.database.JdbcPoolManagerDB

public class JdbcPoolManagerDB
extends ManagerDB

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.

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

Constructor Summary
JdbcPoolManagerDB()
          Connect to the database
JdbcPoolManagerDB(java.lang.String alias, java.lang.String srvdriver, java.lang.String dbserver, java.lang.String srvlogin, java.lang.String srvpassword, int monitorinterval, int maxconnection, int idltimeout, int checkouttimeout, int maxcheckout, java.lang.String shutdownquery)
           
 
Method Summary
 void connect()
           
 void disconnect()
          disconnect() method allows to close the database
 void garbageOpenedConnection()
           
 java.sql.Connection getConnection()
          getConnection() return a free connection or null if all the connections are used after a given time out
 boolean isConnected()
           
 
Methods inherited from class org.openmobileis.common.util.database.ManagerDB
getManager, registerManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcPoolManagerDB

public JdbcPoolManagerDB()
Connect to the database

Throws:
IOException - for log file
java.lang.Exception - : Impossible to find the database or to find the driver

JdbcPoolManagerDB

public JdbcPoolManagerDB(java.lang.String alias,
                         java.lang.String srvdriver,
                         java.lang.String dbserver,
                         java.lang.String srvlogin,
                         java.lang.String srvpassword,
                         int monitorinterval,
                         int maxconnection,
                         int idltimeout,
                         int checkouttimeout,
                         int maxcheckout,
                         java.lang.String shutdownquery)
Method Detail

connect

public void connect()
             throws ServiceException
Throws:
ServiceException

disconnect

public void disconnect()
disconnect() method allows to close the database

Specified by:
disconnect in class ManagerDB
Returns:
None
Throws:
java.sql.SQLException

isConnected

public boolean isConnected()

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
getConnection() return a free connection or null if all the connections are used after a given time out

Specified by:
getConnection in class ManagerDB
Returns:
: Connection
Throws:
: - None
java.sql.SQLException

garbageOpenedConnection

public void garbageOpenedConnection()
Specified by:
garbageOpenedConnection in class ManagerDB


Copyright 2006 OpenMobileIS. All Rights Reserved.