Show TOC

Example documentationExample Program Connect1 Locate this document in the navigation structure

 

Syntax Syntax

  1. import com.sap.mw.jco.*;
  2. public class TutorialConnect1 extends Object {
  3.    JCO.Client mConnection;
  4.    public Connect1() {
  5.      try {
  6.        // Change the logon information to your own system/user
  7.        mConnection =
  8.           JCO.createClient("001", // SAP client
  9.             "", // userid
  10.             "****", // password
  11.             null, // language
  12.             "", // application server host name
  13.             "00"); // system number
  14.        mConnection.connect();
  15.        System.out.println(mConnection.getAttributes());
  16.        mConnection.disconnect();
  17.     }
  18.     catch (Exception ex) {
  19.       ex.printStackTrace();
  20.       System.exit(1);
  21.     }
  22.   }
  23.   public static void main (String args[]) {
  24.     Connect1 app = new Connect1();
  25.   }
  26. }
End of the code.