Show TOC Start of Content Area

Procedure documentation Direct Connections  Locate the document in its SAP Library structure

 

The following section describes an example program for creating a direct connection. For the complete program, see Example Program Connect1.

Activities

...

       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.

Syntax documentation

 Classes

JCO

JCO.Client

JCO.Attributes

 

 

 

Import Statements

 

import com.sap.mw.jco.*;

 

 

 

 

Defining Connection Variables

 

JCO.Client mConnection;

 

 

 

 

Further Information

For information on further procedures, see:

·         Opening a Connection

·         Calling a Function and Closing a Connection

·         Result of the Function Call

The complete example program for establishing a direct connection:

·         Example Program Connect1

 

 

 

End of Content Area