Java Reference
In-Depth Information
form and take advantage of services such as Connection, Transaction, and
Security Management.
That said, you can consider using JCA when you want to access an EIS that offers
a Resource Adapter.
JCA in action
Failing to take a concrete example that shows you how to access the list of employ-
ees managed by SAP with a connector (which would be very long), to allow you to
understand the essential features), the following code shows you just an overview of
the use of the JCA API. These include the general principle of the connection, the
possibility of data manipulation, and disconnection.
For those who wish to go further, GlassFish offers a complete example of im-
plementing a connector to access a mail server, and the tutorial available at ht-
tp://www.ibm.com/developerworks/java/tutorials/j-jca/index.html , provides you addi-
tional information.
The following code is a overview of interactions with a resource adapter:
try {
javax.naming.Context ic = new
InitialContext();
javax.resource.cci.ConnectionFactory cf =
(ConnectionFactory)
ic.lookup("java:comp/env/eis/
ConnectionFactory");
//Connection
javax.resource.cci.Connection ctx =
cf.getConnection();
System.out.println("Information about the
result set functionality " + "supported by the
connected EIS : " +ctx.getResultSetInfo());
System.out.println("Metadata about the
connection : " + ctx.getMetaData());
Search WWH ::




Custom Search