public class GenericConnectionFactory extends Object implements ConnectionFactory
GenericConnectionFactory#getConnection(...)
calls with the same parameter will return the same connection until
the final GenericConnectionFactory#releaseConnection(...)
is called.Constructor and Description |
---|
GenericConnectionFactory() |
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection(ConnectionParams params)
Gets the connection by ConnectionParams.
|
Connection |
getConnection(String name)
Gets the connection by name.
|
boolean |
isReadyToCommit(Connection con)
Checks if connection is ready to commit.
|
void |
releaseConnection(Connection con)
Releases connection.
|
public Connection getConnection(ConnectionParams params) throws Exception
ConnectionFactory
getConnection
in interface ConnectionFactory
params
- the ConnectionParamsException
- in case of any errorpublic Connection getConnection(String name) throws Exception
ConnectionFactory
getConnection
in interface ConnectionFactory
name
- the nameException
- in case of any errorpublic boolean isReadyToCommit(Connection con)
ConnectionFactory
isReadyToCommit
in interface ConnectionFactory
con
- the connectionpublic void releaseConnection(Connection con)
ConnectionFactory
releaseConnection
in interface ConnectionFactory
con
- the connectionCopyright © 2010-2020 Toolsverse. All Rights Reserved.