Package org.openbravo.database
Class JNDIConnectionProvider
- java.lang.Object
-
- org.openbravo.database.JNDIConnectionProvider
-
- All Implemented Interfaces:
ConnectionProvider
public class JNDIConnectionProvider extends Object implements ConnectionProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
JNDIConnectionProvider.PoolInfo
-
Field Summary
Fields Modifier and Type Field Description protected String
defaultPoolName
protected static org.apache.logging.log4j.Logger
log4j
protected static Map<String,JNDIConnectionProvider.PoolInfo>
pools
-
Constructor Summary
Constructors Constructor Description JNDIConnectionProvider(String file, boolean isRelative)
-
Method Summary
-
-
-
Field Detail
-
log4j
protected static org.apache.logging.log4j.Logger log4j
-
pools
protected static Map<String,JNDIConnectionProvider.PoolInfo> pools
-
defaultPoolName
protected String defaultPoolName
-
-
Constructor Detail
-
JNDIConnectionProvider
public JNDIConnectionProvider(String file, boolean isRelative) throws PoolNotFoundException
- Throws:
PoolNotFoundException
-
-
Method Detail
-
getConnection
public Connection getConnection() throws NoConnectionAvailableException
- Specified by:
getConnection
in interfaceConnectionProvider
- Throws:
NoConnectionAvailableException
-
getConnection
public Connection getConnection(String poolName) throws NoConnectionAvailableException
- Throws:
NoConnectionAvailableException
-
getRDBMS
public String getRDBMS()
- Specified by:
getRDBMS
in interfaceConnectionProvider
-
releaseConnection
protected boolean releaseConnection(Connection conn)
-
getTransactionConnection
public Connection getTransactionConnection() throws NoConnectionAvailableException, SQLException
- Specified by:
getTransactionConnection
in interfaceConnectionProvider
- Throws:
NoConnectionAvailableException
SQLException
-
releaseCommitConnection
public void releaseCommitConnection(Connection conn) throws SQLException
- Specified by:
releaseCommitConnection
in interfaceConnectionProvider
- Throws:
SQLException
-
releaseRollbackConnection
public void releaseRollbackConnection(Connection conn) throws SQLException
- Specified by:
releaseRollbackConnection
in interfaceConnectionProvider
- Throws:
SQLException
-
getPreparedStatement
public PreparedStatement getPreparedStatement(String SQLPreparedStatement) throws Exception
- Specified by:
getPreparedStatement
in interfaceConnectionProvider
- Throws:
Exception
-
getPreparedStatement
public PreparedStatement getPreparedStatement(String poolName, String SQLPreparedStatement) throws Exception
- Specified by:
getPreparedStatement
in interfaceConnectionProvider
- Throws:
Exception
-
getPreparedStatement
public PreparedStatement getPreparedStatement(Connection conn, String SQLPreparedStatement) throws SQLException
- Specified by:
getPreparedStatement
in interfaceConnectionProvider
- Throws:
SQLException
-
getCallableStatement
public CallableStatement getCallableStatement(String SQLCallableStatement) throws Exception
- Specified by:
getCallableStatement
in interfaceConnectionProvider
- Throws:
Exception
-
getCallableStatement
public CallableStatement getCallableStatement(String poolName, String SQLCallableStatement) throws Exception
- Specified by:
getCallableStatement
in interfaceConnectionProvider
- Throws:
Exception
-
getCallableStatement
public CallableStatement getCallableStatement(Connection conn, String SQLCallableStatement) throws SQLException
- Specified by:
getCallableStatement
in interfaceConnectionProvider
- Throws:
SQLException
-
getStatement
public Statement getStatement() throws Exception
- Specified by:
getStatement
in interfaceConnectionProvider
- Throws:
Exception
-
getStatement
public Statement getStatement(String poolName) throws Exception
- Specified by:
getStatement
in interfaceConnectionProvider
- Throws:
Exception
-
getStatement
public Statement getStatement(Connection conn) throws SQLException
- Specified by:
getStatement
in interfaceConnectionProvider
- Throws:
SQLException
-
releasePreparedStatement
public void releasePreparedStatement(PreparedStatement preparedStatement) throws SQLException
- Specified by:
releasePreparedStatement
in interfaceConnectionProvider
- Throws:
SQLException
-
releaseCallableStatement
public void releaseCallableStatement(CallableStatement callableStatement) throws SQLException
- Specified by:
releaseCallableStatement
in interfaceConnectionProvider
- Throws:
SQLException
-
releaseStatement
public void releaseStatement(Statement statement) throws SQLException
- Specified by:
releaseStatement
in interfaceConnectionProvider
- Throws:
SQLException
-
releaseTransactionalStatement
public void releaseTransactionalStatement(Statement statement) throws SQLException
- Specified by:
releaseTransactionalStatement
in interfaceConnectionProvider
- Throws:
SQLException
-
releaseTransactionalPreparedStatement
public void releaseTransactionalPreparedStatement(PreparedStatement preparedStatement) throws SQLException
- Specified by:
releaseTransactionalPreparedStatement
in interfaceConnectionProvider
- Throws:
SQLException
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceConnectionProvider
-
getStatus
public String getStatus()
Returns the actual status of the dynamic pool.- Specified by:
getStatus
in interfaceConnectionProvider
-
-