Calling the Subroutine-specific RSC Class

/* @(#) Main.java ver 1.0 00/08/21 14:43:49
 * ???.java, initial version May 2000
 *
 * Copyright (c) 2000 Northgate Information Solutions Plc.
 * All Rights Reserved.

import java.io.*;
import java.util.*;
import com.northgateis.reality.rsc.*;

/**
 * Main class demonstrating how a program can create an
 * instance of Sample to call RW.SAMPLE.
 *
 * @author Kevin Wright
 */
public class Main
{
    
   public static void main(String[] args)
   {
      System.out.println("Starting !!!");

      String host = "localhost";
      int port = 1203;
      String db = "pdb";
      String user = "klw";
      String account = "REALWEB";
      String[] result;
      RSCConnection reality;

      try
      {

         reality = new RSCConnection(host, port, db, user, account);

         reality.connect();

         System.out.println("Connection established to RSC Server");

         Sample sam = new Sample(reality);

         System.out.println("Created Sample object");

         result = sam.execute("param 1", "param 2");
     
         System.out.println("Executed");

         System.out.println(result[0]);
         System.out.println(result[1]);

         reality.disconnect();
      }
      catch (RSCException e)
      {
         System.out.println(e);
      }

      reality = null;

      System.out.println("Finished !!!");
    }
}

Go to top button