net.sourceforge.pbeans.data
Class DefaultDatabaseFactory

java.lang.Object
  extended by net.sourceforge.pbeans.data.DefaultDatabaseFactory
All Implemented Interfaces:
DatabaseFactory

public class DefaultDatabaseFactory
extends java.lang.Object
implements DatabaseFactory

Base implementation of the DatabaseFactory interface.


Constructor Summary
DefaultDatabaseFactory(java.lang.ClassLoader classLoader)
           
 
Method Summary
 Database getDatabase(javax.sql.DataSource dataSource)
          Implements the DatabaseFactory interface.
 void setConnectionTimeout(int timeout)
          Sets the amount of time, in milliseconds, that a connection may be idle before it is discarded.
 void setMaxConnections(int maxConnections)
          Sets the maximum number of simultaneously open connections that a Database is expected to hold.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDatabaseFactory

public DefaultDatabaseFactory(java.lang.ClassLoader classLoader)
Method Detail

setMaxConnections

public void setMaxConnections(int maxConnections)
Sets the maximum number of simultaneously open connections that a Database is expected to hold. Default is 100. This setting only applies to subsequent Database creations.


setConnectionTimeout

public void setConnectionTimeout(int timeout)
Sets the amount of time, in milliseconds, that a connection may be idle before it is discarded. Default is 600000 (10 minutes.) This setting only applies to subsequent Database creations.


getDatabase

public Database getDatabase(javax.sql.DataSource dataSource)
                     throws java.sql.SQLException
Implements the DatabaseFactory interface. It looks at the JDBC URL to determine which class to instantiate.

Specified by:
getDatabase in interface DatabaseFactory
Throws:
java.sql.SQLException