edu.internet2.middleware.subject.provider
Class C3p0JdbcConnectionProvider

java.lang.Object
  extended by edu.internet2.middleware.subject.provider.C3p0JdbcConnectionProvider
All Implemented Interfaces:
JdbcConnectionProvider

public class C3p0JdbcConnectionProvider
extends Object
implements JdbcConnectionProvider


Nested Class Summary
static class C3p0JdbcConnectionProvider.C3p0JdbcConnectionBean
          bean to hold connection
 
Constructor Summary
C3p0JdbcConnectionProvider()
           
 
Method Summary
 JdbcConnectionBean connectionBean()
          get a connection (dont close this when done, just call "doneWithConnection()"
 void init(String sourceId, String driver, Integer maxActive, int defaultMaxActive, Integer maxIdle, int defaultMaxIdle, Integer maxWaitSeconds, int defaultMaxWaitSeconds, String dbUrl, String dbUser, String dbPassword, Boolean readOnly, boolean readOnlyDefault)
          init the pool
 boolean requiresJdbcConfigInSourcesXml()
          if the provider requires jdbc data in the sources.xml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

C3p0JdbcConnectionProvider

public C3p0JdbcConnectionProvider()
Method Detail

connectionBean

public JdbcConnectionBean connectionBean()
                                  throws SQLException
Description copied from interface: JdbcConnectionProvider
get a connection (dont close this when done, just call "doneWithConnection()"

Specified by:
connectionBean in interface JdbcConnectionProvider
Returns:
the connection
Throws:
SQLException - if there is a problem
See Also:
JdbcConnectionProvider.connectionBean()

init

public void init(String sourceId,
                 String driver,
                 Integer maxActive,
                 int defaultMaxActive,
                 Integer maxIdle,
                 int defaultMaxIdle,
                 Integer maxWaitSeconds,
                 int defaultMaxWaitSeconds,
                 String dbUrl,
                 String dbUser,
                 String dbPassword,
                 Boolean readOnly,
                 boolean readOnlyDefault)
          throws SourceUnavailableException
Description copied from interface: JdbcConnectionProvider
init the pool

Specified by:
init in interface JdbcConnectionProvider
Parameters:
sourceId - mainly for logging
driver - driver
maxActive - max active connection if pool
defaultMaxActive - if max active is needed, and blank, then use this
maxIdle - max idle connections if pool
defaultMaxIdle - if max is needed, and blank, then use this
maxWaitSeconds - max wait if pool empty in seconds. -1 means long time
defaultMaxWaitSeconds - if max wait is needed, and blank, then use this, -1 mean long time
dbUrl - jdbc url of the database
dbUser - user to login to the database
dbPassword - password for the database (unencrypted)
readOnly - if conn should be readonly
readOnlyDefault - default if not specified and needed
Throws:
SourceUnavailableException - if something is not right or not available
See Also:
JdbcConnectionProvider.init(java.lang.String, java.lang.String, java.lang.Integer, int, java.lang.Integer, int, java.lang.Integer, int, java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean, boolean)

requiresJdbcConfigInSourcesXml

public boolean requiresJdbcConfigInSourcesXml()
Description copied from interface: JdbcConnectionProvider
if the provider requires jdbc data in the sources.xml

Specified by:
requiresJdbcConfigInSourcesXml in interface JdbcConnectionProvider
Returns:
true if provider requires data in sources.xml
See Also:
JdbcConnectionProvider.requiresJdbcConfigInSourcesXml()