deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.commons.jdbc
Class ConnectionManager

java.lang.Object
  extended by org.deegree.commons.jdbc.ConnectionManager

public class ConnectionManager
extends Object

Entry point for accessing JDBC connections in deegree that are defined in configuration files.

Configuration of JDBC connections used in deegree is based on simple string identifiers: each configured JDBC connection has a unique identifier. This class allows the retrieval of connections based on their identifier.

Version:
$Revision: $, $Date: $
Author:
Markus Schneider, last edited by: $Author: schneider $

Constructor Summary
ConnectionManager()
           
 
Method Summary
static void addConnection(PooledConnection jaxbConn)
          Adds a connection pool from the given pool definition.
static void addConnection(String id, DatabaseType type, String url, String user, String password, int poolMinSize, int poolMaxSize)
          Adds a connection pool as specified in the parameters.
static void addConnections(JDBCConnections jaxbConns)
          Adds connection pools for the given pool definitions.
static void addConnections(URL jdbcConfigUrl)
          Adds the connection pools defined in the given file.
static void destroy()
           
static Connection getConnection(String id)
          Returns a connection from the connection pool with the given id.
static DatabaseType getConnectionType(String id)
          Returns the database type for the connection pool with the given id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionManager

public ConnectionManager()
Method Detail

destroy

public static void destroy()

getConnection

public static Connection getConnection(String id)
                                throws SQLException
Returns a connection from the connection pool with the given id.

Parameters:
id - id of the connection pool
Returns:
connection from the corresponding connection pool
Throws:
SQLException - if the connection pool is unknown or a SQLException occurs creating the connection

getConnectionType

public static DatabaseType getConnectionType(String id)
                                      throws SQLException
Returns the database type for the connection pool with the given id.

Parameters:
id - id of the connection pool
Returns:
corresponding database type
Throws:
SQLException - if the connection pool is unknown or a SQLException occurs creating the connection

addConnections

public static void addConnections(URL jdbcConfigUrl)
                           throws JAXBException
Adds the connection pools defined in the given file.

Parameters:
jdbcConfigUrl -
Throws:
JAXBException

addConnections

public static void addConnections(JDBCConnections jaxbConns)
Adds connection pools for the given pool definitions.

Parameters:
jaxbConns -

addConnection

public static void addConnection(PooledConnection jaxbConn)
Adds a connection pool from the given pool definition.

Parameters:
jaxbConn -

addConnection

public static void addConnection(String id,
                                 DatabaseType type,
                                 String url,
                                 String user,
                                 String password,
                                 int poolMinSize,
                                 int poolMaxSize)
Adds a connection pool as specified in the parameters.

Parameters:
id -
type -
url -
user -
password -
poolMinSize -
poolMaxSize -

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>