The following section describes an example program for creating a direct connection. For the complete program, see Example Program Connect1.
...
1. 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.
2. 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.
3. You then define a connection variable for contacting a specified client of the SAP system.
JCO JCO.Client JCO.Attributes
|
import com.sap.mw.jco.*;
|
JCO.Client mConnection;
|
For information on further procedures, see:
· Calling a Function and Closing a Connection
The complete example program for establishing a direct connection: