org.jaffa.persistence.engines.jdbcengine.datasource
Class DbConnectionBrokerConnectionFactory

java.lang.Object
  extended byorg.jaffa.persistence.engines.jdbcengine.datasource.DbConnectionBrokerConnectionFactory
All Implemented Interfaces:
IConnectionFactory

public class DbConnectionBrokerConnectionFactory
extends Object
implements IConnectionFactory

This is a DbConnectionBroker based implementation of IConnectionFactory. DbConnectionBroker is a fairly proven and stable implemenation for database connection pooling. It requires 'dbConnectionBroker.jar' in the classpath.

Author:
GautamJ

Constructor Summary
DbConnectionBrokerConnectionFactory()
           
 
Method Summary
 Connection createConnection()
          Creates a connection using DbConnectionBroker.
 void freeConnection(Connection connection)
          Returns the connection back to the pool.
 Integer getDebugLevel()
          Getter for property debugLevel.
 String getDriverClass()
          Getter for property driverClass.
 Boolean getLogAppend()
          Getter for property logAppend.
 String getLogFileName()
          Getter for property logFileName.
 Integer getMaxCheckoutSeconds()
          Getter for property maxCheckoutSeconds.
 Double getMaxConnTime()
          Getter for property maxConnTime.
 Integer getMaximumConnections()
          Getter for property maximumConnections.
 Integer getMinimumConnections()
          Getter for property minimumConnections.
 String getPassword()
          Getter for property password.
 String getUrl()
          Getter for property url.
 String getUser()
          Getter for property user.
 void setDebugLevel(Integer debugLevel)
          Setter for property debugLevel.
 void setDriverClass(String driverClass)
          Setter for property driverClass.
 void setLogAppend(Boolean logAppend)
          Setter for property logAppend.
 void setLogFileName(String logFileName)
          Setter for property logFileName.
 void setMaxCheckoutSeconds(Integer maxCheckoutSeconds)
          Setter for property maxCheckoutSeconds.
 void setMaxConnTime(Double maxConnTime)
          Setter for property maxConnTime.
 void setMaximumConnections(Integer maximumConnections)
          Setter for property maximumConnections.
 void setMinimumConnections(Integer minimumConnections)
          Setter for property minimumConnections.
 void setPassword(String password)
          Setter for property password.
 void setUrl(String url)
          Setter for property url.
 void setUser(String user)
          Setter for property user.
 boolean usePreparedStatementCaching()
          Returns a true if the Prepared (and Call) Statements are to be cached for a connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbConnectionBrokerConnectionFactory

public DbConnectionBrokerConnectionFactory()
Method Detail

getDriverClass

public String getDriverClass()
Getter for property driverClass.

Returns:
Value of property driverClass.

setDriverClass

public void setDriverClass(String driverClass)
Setter for property driverClass.

Parameters:
driverClass - New value of property driverClass.

getUrl

public String getUrl()
Getter for property url.

Returns:
Value of property url.

setUrl

public void setUrl(String url)
Setter for property url.

Parameters:
url - New value of property url.

getUser

public String getUser()
Getter for property user.

Returns:
Value of property user.

setUser

public void setUser(String user)
Setter for property user.

Parameters:
user - New value of property user.

getPassword

public String getPassword()
Getter for property password.

Returns:
Value of property password.

setPassword

public void setPassword(String password)
Setter for property password.

Parameters:
password - New value of property password.

getMinimumConnections

public Integer getMinimumConnections()
Getter for property minimumConnections.

Returns:
Value of property minimumConnections.

setMinimumConnections

public void setMinimumConnections(Integer minimumConnections)
Setter for property minimumConnections.

Parameters:
minimumConnections - New value of property minimumConnections.

getMaximumConnections

public Integer getMaximumConnections()
Getter for property maximumConnections.

Returns:
Value of property maximumConnections.

setMaximumConnections

public void setMaximumConnections(Integer maximumConnections)
Setter for property maximumConnections.

Parameters:
maximumConnections - New value of property maximumConnections.

getLogFileName

public String getLogFileName()
Getter for property logFileName.

Returns:
Value of property logFileName.

setLogFileName

public void setLogFileName(String logFileName)
Setter for property logFileName.

Parameters:
logFileName - New value of property logFileName.

getMaxConnTime

public Double getMaxConnTime()
Getter for property maxConnTime.

Returns:
Value of property maxConnTime.

setMaxConnTime

public void setMaxConnTime(Double maxConnTime)
Setter for property maxConnTime.

Parameters:
maxConnTime - New value of property maxConnTime.

getLogAppend

public Boolean getLogAppend()
Getter for property logAppend.

Returns:
Value of property logAppend.

setLogAppend

public void setLogAppend(Boolean logAppend)
Setter for property logAppend.

Parameters:
logAppend - New value of property logAppend.

getMaxCheckoutSeconds

public Integer getMaxCheckoutSeconds()
Getter for property maxCheckoutSeconds.

Returns:
Value of property maxCheckoutSeconds.

setMaxCheckoutSeconds

public void setMaxCheckoutSeconds(Integer maxCheckoutSeconds)
Setter for property maxCheckoutSeconds.

Parameters:
maxCheckoutSeconds - New value of property maxCheckoutSeconds.

getDebugLevel

public Integer getDebugLevel()
Getter for property debugLevel.

Returns:
Value of property debugLevel.

setDebugLevel

public void setDebugLevel(Integer debugLevel)
Setter for property debugLevel.

Parameters:
debugLevel - New value of property debugLevel.

createConnection

public Connection createConnection()
                            throws SQLException,
                                   IOException
Creates a connection using DbConnectionBroker.

Specified by:
createConnection in interface IConnectionFactory
Returns:
a Connection
Throws:
SQLException - if any SQL error occurs
IOException - if any IO error occurs

freeConnection

public void freeConnection(Connection connection)
                    throws SQLException,
                           IOException
Returns the connection back to the pool.

Specified by:
freeConnection in interface IConnectionFactory
Parameters:
connection - The connection to return back to the pool.
Throws:
SQLException - if any SQL error occurs
IOException - if any IO error occurs

usePreparedStatementCaching

public boolean usePreparedStatementCaching()
Returns a true if the Prepared (and Call) Statements are to be cached for a connection. This will return a true.

Specified by:
usePreparedStatementCaching in interface IConnectionFactory
Returns:
a true if the Prepared (and Call) Statements are to be cached for a connection.


Copyright © 2002-2004 JAFFA Project.