Connection (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.resource.cci Interface Connection


public interface Connection

A 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 getConnection method on a ConnectionFactory instance. A connection can be associated with zero or more Interaction instances.

版本:
0.8
作者:
Rahul Sharma
另请参见:
ConnectionFactory, Interaction

方法摘要
 void close()
          Initiates close of the connection handle at the application level.
 Interaction createInteraction()
          Creates an Interaction associated with this Connection.
 LocalTransaction getLocalTransaction()
          Returns an LocalTransaction instance that enables a component to demarcate resource manager local transactions on the Connection.
 ConnectionMetaData getMetaData()
          Gets the information on the underlying EIS instance represented through an active connection.
 ResultSetInfo getResultSetInfo()
          Gets the information on the ResultSet functionality supported by a connected EIS instance.
 

方法详细信息

createInteraction

Interaction createInteraction()
                              throws ResourceException
Creates an Interaction associated with this Connection. An Interaction enables an application to execute EIS functions.

返回:
Interaction instance
抛出异常:
ResourceException - Failed to create an Interaction

getLocalTransaction

LocalTransaction getLocalTransaction()
                                     throws ResourceException
Returns 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.

返回:
LocalTransaction instance
抛出异常:
ResourceException - Failed to return a LocalTransaction instance because of a resource adapter error
NotSupportedException - Demarcation of Resource manager local transactions is not supported on this Connection
另请参见:
LocalTransaction

getMetaData

ConnectionMetaData getMetaData()
                               throws ResourceException
Gets 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.

getResultSetInfo

ResultSetInfo getResultSetInfo()
                               throws ResourceException
Gets the information on the ResultSet functionality supported by a connected EIS instance.

返回:
ResultSetInfo instance
抛出异常:
ResourceException - Failed to get ResultSet related information
NotSupportedException - ResultSet functionality is not supported

close

void close()
           throws ResourceException
Initiates 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.


Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.