org.geotools.data.jdbc.datasource
Class DataSourceUtil

Object
  extended by DataSourceUtil

public class DataSourceUtil
extends Object

Utility methods to build a default connection pool

Author:
Andrea Aime - TOPP
Module:
modules/library/jdbc (gt-jdbc.jar)

Method Summary
static ManageableDataSource buildDefaultDataSource(String url, String driverName, String username, String password, int maxActive, int minIdle, String validationQuery, boolean cachePreparedStatements, int removeAbandonedTimeout)
          Builds up a default DBCP DataSource that easy to use connection factories can use to setup a connection pool.
static ManageableDataSource buildDefaultDataSource(String url, String driverName, String username, String password, String validationQuery)
          Builds up a default DBCP DataSource that easy to use connection factories can use to setup a connection pool.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildDefaultDataSource

public static ManageableDataSource buildDefaultDataSource(String url,
                                                          String driverName,
                                                          String username,
                                                          String password,
                                                          String validationQuery)
                                                   throws DataSourceException
Builds up a default DBCP DataSource that easy to use connection factories can use to setup a connection pool.

Parameters:
url - the jdbc url
driverName - the jdbc driver full qualified class name
username -
password -
validationQuery - the validation query to be used for connection liveliness on borrow, or null, if no check is to be performed
Returns:
Throws:
DataSourceException

buildDefaultDataSource

public static ManageableDataSource buildDefaultDataSource(String url,
                                                          String driverName,
                                                          String username,
                                                          String password,
                                                          int maxActive,
                                                          int minIdle,
                                                          String validationQuery,
                                                          boolean cachePreparedStatements,
                                                          int removeAbandonedTimeout)
                                                   throws DataSourceException
Builds up a default DBCP DataSource that easy to use connection factories can use to setup a connection pool.

Parameters:
url - the jdbc url
driverName - the jdbc driver full qualified class name
username -
password -
maxActive - maximum number of concurrent connections in the pool
minIdle - minimum number of concurrent connections in the pool
validationQuery - the validation query to be used for connection liveliness on borrow, or null, if no check is to be performed
cachePreparedStatements - wheter to cache prepared statements or not
Returns:
Throws:
DataSourceException


Copyright © 1996-2009 Geotools. All Rights Reserved.