public interface ConnectionA Connection represents an application-level handle that is used by a client to access the underlying physical connection. The actual physical connection associated with a Connection instance is represented by a ManagedConnection instance.
A client gets a Connection instance by using the
getConnectionmethod on a
ConnectionFactoryinstance. A connection can be associated with zero or more Interaction instances.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
close()Initiates close of the connection handle at the application level.
createInteraction()Creates an Interaction associated with this Connection.
getLocalTransaction()Returns an LocalTransaction instance that enables a component to demarcate resource manager local transactions on the Connection.
getMetaData()Gets the information on the underlying EIS instance represented through an active connection.
getResultSetInfo()Gets the information on the ResultSet functionality supported by a connected EIS instance.
Interaction createInteraction() throws ResourceExceptionCreates an Interaction associated with this Connection. An Interaction enables an application to execute EIS functions.
- Interaction instance
ResourceException- Failed to create an Interaction
LocalTransaction getLocalTransaction() throws ResourceExceptionReturns an LocalTransaction instance that enables a component to demarcate resource manager local transactions on the Connection. If a resource adapter does not allow a component to demarcate local transactions on an Connection using LocalTransaction interface, then the method getLocalTransaction should throw a NotSupportedException.
ConnectionMetaData getMetaData() throws ResourceExceptionGets the information on the underlying EIS instance represented through an active connection.
- ConnectionMetaData instance representing information about the EIS instance
ResourceException- Failed to get information about the connected EIS instance. Error can be resource adapter-internal, EIS-specific or communication related.
ResultSetInfo getResultSetInfo() throws ResourceExceptionGets the information on the ResultSet functionality supported by a connected EIS instance.
void close() throws ResourceExceptionInitiates close of the connection handle at the application level. A client should not use a closed connection to interact with an EIS.
ResourceException- Exception thrown if close on a connection handle fails.
Any invalid connection close invocation--example, calling close on a connection handle that is already closed--should also throw this exception.