public final class ConnectionFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static Connection |
getConnection(String jndiName)
Return a Connection instance for a JNDI managed JDBC connection.
|
static Connection |
getConnection(String driver,
ConnectionSpec connectionSpec,
ConnectionPoolSpec poolSpec)
Return a Connection instance from a pool that managed JDBC driver based connections.
|
static Connection |
getConnection(String driver,
String url,
Map<String,String> properties,
ConnectionPoolSpec poolSpec)
Return a Connection instance from a pool that manages JDBC driver based connections.
|
static void |
reset()
Resets the internal state of the factory.
|
public static Connection getConnection(String jndiName) throws FactoryException
jndiName - The JNDI connection nameFactoryException - When the connection cannot be retrieved from JNDIpublic static Connection getConnection(String driver, ConnectionSpec connectionSpec, ConnectionPoolSpec poolSpec) throws FactoryException
driver - The JDBC driver class to useconnectionSpec - The connection spec to usepoolSpec - A connection pool specFactoryException - When the connection cannot be retrieved from the pool, or the pool cannot be createdpublic static Connection getConnection(String driver, String url, Map<String,String> properties, ConnectionPoolSpec poolSpec) throws FactoryException
driver - The JDBC driver class to useurl - The JDBC database URL of the form jdbc:subprotocol:subnameproperties - A list of key/value configuration parameters to pass as connection arguments. Normally at
least a "user" and "password" property should be includedpoolSpec - A connection pool specFactoryException - When the connection cannot be retrieved from the pool, or the pool cannot be createdpublic static void reset()
Copyright © 2014 Michael Beiter