Start of Content Area

Procedure documentation Calling a Function and Closing a Connection  Locate the document in its SAP Library structure

Activities

The following describes how to call a function in an SAP server. This is illustrated using a simple example, in which the RFC attributes of the connection are queried. The relevant coding is displayed in the diagram (calling a function). To close a connection, choose

mConnection.disconnect();

Note

Unlike in connection pools, for direct connections it is not recommended to call a function and then close the connection immediately afterwards (until the next function call).A direct connection should only be closed if no activity is expected for a long period of time.

Syntax documentation

Calling a Function

 

 

System.out.println (mConnection.getAttributes () );

 

 

 

 

 

 

 

 

Closing a Connection

 

 

mConnection.disconnect ();

 

 

 

 

 

 

 

 Further Information

For information on further procedures, see:

·         Result of the Function Call

The complete example program for establishing a direct connection:

·         Example Program Connect1

 

 

 

End of Content Area