Show TOC

Example documentationExample Program Connect2 Locate this document in the navigation structure

 

Syntax Syntax

  1. import com.sap.mw.jco.*;
  2. public class Connect2 extends Object {
  3.    static final String POOL_NAME = "Pool";
  4.    JCO.Client mConnection;
  5.    public Connect2() {
  6.      try {
  7.        JCO.Pool pool = JCO.getClientPoolManager().getPool(POOL_NAME);
  8.        if (pool == null) {
  9.          OrderedProperties logonProperties =
  10.            OrderedProperties.load("/logon.properties");
  11.          JCO.addClientPool(POOL_NAME, // pool name
  12.                            5, // maximum number of                                   
  13.                                  connections
  14.                            logonProperties); // properties
  15.        }
  16.        mConnection = JCO.getClient(POOL_NAME);
  17.        System.out.println(mConnection.getAttributes());
  18.     }
  19.     catch (Exception ex) {
  20.       ex.printStackTrace();
  21.     }
  22.     finally {
  23.       JCO.releaseClient(mConnection);
  24.     }
  25.   }
  26.   public static void main (String args[]) {
  27.     Connect2 app = new Connect2();
  28.   }
  29. }
End of the code.