Package com.microsoft.sqlserver.jdbc
Class SQLServerPooledConnection
java.lang.Object
com.microsoft.sqlserver.jdbc.SQLServerPooledConnection
- All Implemented Interfaces:
java.io.Serializable,javax.sql.PooledConnection
- Direct Known Subclasses:
SQLServerXAConnection
public class SQLServerPooledConnection
extends java.lang.Object
implements javax.sql.PooledConnection, java.io.Serializable
Represents a physical database connection in a connection pool. If provides methods for the connection pool manager
to manage the connection pool. Applications typically do not instantiate these connections directly.
- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description voidaddConnectionEventListener(javax.sql.ConnectionEventListener listener)voidaddStatementEventListener(javax.sql.StatementEventListener listener)voidclose()java.sql.ConnectiongetConnection()Returns an object handle for the physical connection that this PooledConnection object represents.voidremoveConnectionEventListener(javax.sql.ConnectionEventListener listener)voidremoveStatementEventListener(javax.sql.StatementEventListener listener)java.lang.StringtoString()Provides a helper function to provide an ID string suitable for tracing.
-
Method Details
-
toString
public java.lang.String toString()Provides a helper function to provide an ID string suitable for tracing.- Overrides:
toStringin classjava.lang.Object- Returns:
- traceID String
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLExceptionReturns an object handle for the physical connection that this PooledConnection object represents.- Specified by:
getConnectionin interfacejavax.sql.PooledConnection- Returns:
- a Connection object that is a handle to this PooledConnection object
- Throws:
java.sql.SQLException- when an error occurs
-
addConnectionEventListener
public void addConnectionEventListener(javax.sql.ConnectionEventListener listener)- Specified by:
addConnectionEventListenerin interfacejavax.sql.PooledConnection
-
close
public void close() throws java.sql.SQLException- Specified by:
closein interfacejavax.sql.PooledConnection- Throws:
java.sql.SQLException
-
removeConnectionEventListener
public void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)- Specified by:
removeConnectionEventListenerin interfacejavax.sql.PooledConnection
-
addStatementEventListener
public void addStatementEventListener(javax.sql.StatementEventListener listener)- Specified by:
addStatementEventListenerin interfacejavax.sql.PooledConnection
-
removeStatementEventListener
public void removeStatementEventListener(javax.sql.StatementEventListener listener)- Specified by:
removeStatementEventListenerin interfacejavax.sql.PooledConnection
-