The following section describes an example program for creating a direct connection. For the complete program, see Example Program Connect1.
For establishing direct connections, you need the following classes:
JCO:This is the main class of the SAPJCo. It contains many useful static methods.
JCO.Client: This class represents a connection to the SAP server.
JCO.Attributes: These classes contain the attributes of a connection, for example, the release of the SAP system.
In addition, each program that the SAP JCo uses contains the import statement displayed below. If this was not the case, you would have to qualify all the JCo classes and interfaces individually.
You then define a connection variable for contacting a specified client of the SAP system.
Syntax
Classes
JCO JCO.Client JCO.Attributes |
Import Statements
import com.sap.mw.jco.*; |
Defining Connection Variables
JCO.Client mConnection; |
For information on further procedures, see:
The complete example program for establishing a direct connection: