OpenEdge provides a Connection class, com.progress.open4gl.javaproxy.Connection. This Connection object provides a means to store AppServer connection information, which can be passed to the AppObject constructor when connecting to the AppServer.
The Connection object has two constructors, as shown in the syntax boxes that follows.
The following constructor specifies the AppServer connection information (url), user ID, password, and information required by the AppServer application at connection time:
Syntax
public Connection(String url, String userid, String password,
String AppServer-info)
Note: The combined length of the url, userid, password, and AppServer-info fields must not exceed 30,000 non-Unicode characters when connecting to an AppServer.
For more information on the AppServer URL connection parameter format and default connection information, see the sections on connecting to an AppServer using a URL in OpenEdge Application Server: Developing AppServer Applications.
The following constructor specifies the user ID, password, and information required by the AppServer application at connection time:
Syntax
public Connection(String userid, String password, String appserver-info)
The constructor above uses default AppServer connection information. This defaults the URL to AppServer://localhost:5162/appService, where appService is the AppService Name setting specified in the general settings of the ProxyGen Generate Proxies dialog box.
Before you establish a connection, you can set properties for the Connection object. See AccessingProxy Properties for information on setting and updating Connection object properties.
In particular, the Connection class has a clientPrincipal property, which associates a ClientPrincipal object with a Connection object. A ClientPrincipal object acts as a token for passing security information, like user credentials, between various parts of an application. See Clientprincipal class for more information about ClientPrincipal objects.