Package com.databricks.jdbc.pooling
Class DatabricksPooledConnection
- java.lang.Object
-
- com.databricks.jdbc.pooling.DatabricksPooledConnection
-
- All Implemented Interfaces:
PooledConnection
public class DatabricksPooledConnection extends Object implements PooledConnection
-
-
Constructor Summary
Constructors Constructor Description DatabricksPooledConnection(Connection physicalConnection)Creates a new PooledConnection representing the specified physical connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectionEventListener(ConnectionEventListener connectionEventListener)voidaddStatementEventListener(StatementEventListener listener)voidclose()Close the physical connection once the pooled connection is closedConnectiongetConnection()Gets a handle for a client to use.ConnectiongetPhysicalConnection()voidremoveConnectionEventListener(ConnectionEventListener connectionEventListener)voidremoveStatementEventListener(StatementEventListener listener)
-
-
-
Constructor Detail
-
DatabricksPooledConnection
public DatabricksPooledConnection(Connection physicalConnection)
Creates a new PooledConnection representing the specified physical connection.- Parameters:
physicalConnection- connection
-
-
Method Detail
-
addConnectionEventListener
public void addConnectionEventListener(ConnectionEventListener connectionEventListener)
- Specified by:
addConnectionEventListenerin interfacePooledConnection
-
removeConnectionEventListener
public void removeConnectionEventListener(ConnectionEventListener connectionEventListener)
- Specified by:
removeConnectionEventListenerin interfacePooledConnection
-
removeStatementEventListener
public void removeStatementEventListener(StatementEventListener listener)
- Specified by:
removeStatementEventListenerin interfacePooledConnection
-
addStatementEventListener
public void addStatementEventListener(StatementEventListener listener)
- Specified by:
addStatementEventListenerin interfacePooledConnection
-
close
public void close() throws SQLExceptionClose the physical connection once the pooled connection is closed- Specified by:
closein interfacePooledConnection- Throws:
SQLException
-
getConnection
public Connection getConnection() throws SQLException
Gets a handle for a client to use. This is a wrapper around the physical connection, so the client can call close, and it will just return the connection to the pool without really closing the physical connection.According to the JDBC 4.3 Optional Package spec (11.4), only one client may have an active handle to the connection at a time, so if there is a previous handle active when this is called, the previous one is forcibly closed.
- Specified by:
getConnectionin interfacePooledConnection- Throws:
SQLException
-
getPhysicalConnection
public Connection getPhysicalConnection()
-
-