Show TOC

Procedure documentationCalling a Function and Closing a Connection Locate this document in the navigation structure

Procedure

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 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.

End of the note.

Calling a Function

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

Closing a Connection

mConnection.disconnect ();

More Information

For information on further procedures, see:

The complete example program for establishing a direct connection: