Professional Documents
Culture Documents
Siddhartha Bhattacharya
SAP Java Resource Adapter Overview
Contents:
z J2EE Connector Architecture Overview
z SAP Java Resource Adapter Overview
z Installing SAP Resource Adapter using Deploy Tool
z Programming model of the SAP Resource Adapter
Architecture
For seamless integration with an application server, a resource adapter must abide by guidelines -- known
as system-level contracts -- that are defined by the Connector Architecture. These contracts exist between
the application server and an EIS, and are implemented through the resource adapter. They specify how a
system external to the J2EE platform can integrate with it by supporting basic functions that are handled
by the J2EE container. The most important functions are those involved with connection management,
transaction management, security, message inflow, work management, and lifecycle management
JCA (J2EE Connector Architecture)
What are the different system level contracts that any JCA
compliant adapter must follow ?
Architecture
2 phase commit and re-authentication of connections is not supported by SAP R/3 so they are not
supported by SAP JRA.
SAP Java Resource Adapter
Link to download SAP JRA is http://service.sap.com/connectors -> SAP Java Connector ->Tools and
Services -> SAP Java Resource Adapter
Installing SAP Resource Adapter
Link to download SAP JRA is http://service.sap.com/connectors -> SAP Java Connector ->Tools and
Services -> SAP Java Resource Adapter
Installing SAP Resource Adapter : Topic Summary
The CCI provides the access from J2EE clients, such as enterprise
beans, Java Server Pages (JSP) technology, and servlets, to an
underlying enterprise information system (EIS).
These are the Java classes defined in the CCI and some of the
more important methods
Getting a Connection
Assume that the name “eis/SAPJRAFactory” is already refined in the
web.xml deployment descriptor. The first step is to lookup the
ConnectionFactory by this JNDI name.
Next step is to create a Connection object using the ConnectionFactory
method getConnection()
connectionfactory = (ConnectionFactory)
ctx.lookup("java:comp/env/eis/SAPJRAFactory");
connection = connectionfactory.getConnection();
The JNDI name “eis/SAPJRAFactory” actually resolves to the runtime SAP JRA
Connection Factory.
Programming Model : Create RecordFactory and Interaction
RecordFactory recordfactory =
connectionfactory.getRecordFactory();
Interaction interaction =
connection.createInteraction();
MappedRecord input =
connectionfactory.getRecordFactory().createMappedRecord("
BAPI_COMPANYCODE_GETLIST");
while( list.next())
out.println("<tr><td>" + list.getObject(1).toString()
+"</td><td>"+list.getObject(2).toString()+
"</td></tr>");
out.println ( "</table>");
interaction.close();