A DTS Programming Example in Java/DTSJAVA

You may download the original source file from here.

The application front-end module in Java



Front-end

/*
 * Example DTS front-end application
 * 
 * Perform a simple query to the remote handler HELLO
 * using the DTS class library interface
 *
 * Language:        Java
 * Intented for:    DTSJAVA package
 * Date:            30-OCT-1997
 *
 */

import tascomm.dts.DTSMessage;                  // The DTS message class
import tascomm.dts.DTSException;                // Class for DTS exceptions

class front
{
     public static void main(String[] args)
     {
          DTSMessage smallMessage =             // Construct a new message
            new DTSMessage("HELLO",             // Remote handler name
                           "TestProgram");      // Our name as data
          try
          {
               smallMessage.execute();          // Call the default DTS server
               System.out.println
                 ("Message received : \n"+      // Print out response
                  smallMessage.getDataString());
          }
          catch (DTSException dtse)             // If something goes wrong,
          {                                     // Print out error response
               System.out.println
                 ("Call failed : "+dtse.getMessage());
          }
     }
}

// end of source
© Copyright 2000 Tascomm Engineering Oy Home  Company  Products  Services  Customers  News