The JCo API offers eight distinct JCO.createClient() methods to establish a connection to the SAP application server. Eight uses of the same connection method may seem to be a bit overwhelming at first. In actuality, there are really only three mechanisms used by the JCo API to pass values to the createClient() method. This article reviews these mechanisms and offers some recommendations on the best way to pass system parameters to an SAP JCo connection.
The most basic use of createClient() is to simply call this method by passing the required parameters as String values. These are relatively quick and dirty connections to SAP, and are mainly useful in a development effort that requires a basic connection to the SAP application server.
The second mechanism for calling createClient() entails the use of a multi-dimensional String array where parameters are passed as name/value pairs. This technique is more robust than the first and allows you to pass more system parameters to SAP.
The third mechanism allows you to pass an external properties file with name/value pairs as a single value to the createClient() method. This is useful when a centralized configuration is required.
In addition to the first method mentioned above, the JCo API provides 5 other versions of the createClient() method that allow you to pass String parameters directly. The differences between each version illustrate the different connection mechanisms available in the SAP server landscape. These range from connecting to a single SAP application server with no load balancing, to calling a message server that supports logon load balancing across an SAP system, to executing a registered RFC server program on a remote system. This article focuses on the transport mechanisms rather than on the varied system landscape connections. However, each example can be tailored to the specific configuration of your SAP systems.

GETTING CONNECTED WITH JCO

Home: Introduction
Part 1: Specifying parameters as single String values
Part 2: Specifying parameters using a String array
Part 3: Specifying parameters using an external properties file
Part 4: Specifying parameters with a custom properties file
Review: Conclusion and more resources
| ABOUT THE AUTHOR: |
|
Austin Sincock, technical author and SAP/Java evangelist Austin Sincock is a freelance SAP integration architect, specializing in high performance Java development for SAP. He is also the author of Enterprise Java for SAP.
Copyright 2005 TechTarget
|
|