|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.commons.jdbc.ConnectionManager
public class ConnectionManager
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.
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 |
---|
public ConnectionManager()
Method Detail |
---|
public static void destroy()
public static Connection getConnection(String id) throws SQLException
id
- id of the connection pool
SQLException
- if the connection pool is unknown or a SQLException occurs creating the connectionpublic static DatabaseType getConnectionType(String id) throws SQLException
id
- id of the connection pool
SQLException
- if the connection pool is unknown or a SQLException occurs creating the connectionpublic static void addConnections(URL jdbcConfigUrl) throws JAXBException
jdbcConfigUrl
-
JAXBException
public static void addConnections(JDBCConnections jaxbConns)
jaxbConns
- public static void addConnection(PooledConnection jaxbConn)
jaxbConn
- public static void addConnection(String id, DatabaseType type, String url, String user, String password, int poolMinSize, int poolMaxSize)
id
- type
- url
- user
- password
- poolMinSize
- poolMaxSize
-
|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |