Manually Setting the Properties of SessionInfo 

Use

If you do not use a properties file to set up the connection parameters, you need to set the necessary connection information by manually setting the properties of the SessionInfo object.

Procedure

  1. Instantiate the SessionManager object.
  2. Set the properties of SessionInfo.
  3. Use the open method of the SessionManager to start a session.

Result

The SessionManager starts a connection using the properties of SessionInfo.

If the connection is established successfully, the SessionManager writes the connection information into the r3_connection.props properties file (except for password information). If the properties file does not exist, it creates it. If it exists, it rewrites its contents.

Next Step

You can now use the connection to create, manage, and call RFC function module(s).

Your next step is to set up the IRfcModule object and all of its parameters.

Example

The following code example sets the various properties of SessionInfo. It then starts a session.

// Create an instance of the SessionManager:
SessionManager sessionMgr = SessionManager.getInstance();
// Enter properties using the JDK1.2 setProperty method
Properties props = new java.util.Properties();
props.setProperty(SessionInfo.PROP_KEY_MIDDLEWARE_SERVER_NAME, "ORBMachine1");
//... (set other middleware properties)
props.setProperty(SessionInfo.PROP_KEY_CONNECTION_HOST_NAME, "205.215.205.15");
//... (set other connection properties)
props.setProperty(SessionInfo.PROP_KEY_USER_USER_NAME, "JoeUser");
//... (set other user properties)
// Set SessionInfo with the session information
sessionMgr.setSessionInfo(props);
// Start the session
sessionManager.open();