Chapter 6 Using Adaptive Server Anywhere with Jaguar


Building applications that access Adaptive Server Anywhere databases

To build applications that access Adaptive Server Anywhere database, you must first create components and clients. This section gives an overview of how to create components and clients. See the Jaguar CTS Programmer's Guide for detailed information.

Jaguar applications are composed of clients and a Jaguar server that hosts components. Clients can run on different machines; the components execute on the server machine as part of the Jaguar server process. Some components, in turn, connect to databases, such as Adaptive Server Anywhere, on other machines.

Developing components

You can create Java/EJB, C++ (CORBA), C, PowerBuilder, and ActiveX components. You use any development tool that supports the type of component you are creating.

Steps To create components, follow this general procedure:

  1. Use Jaguar Manager to define the interface of the component and set the functionality of transactions, connection caches, and instance pooling for the component.

    Note   Instead of using Jaguar Manager to define component interfaces, you can define them in a Java source file and import it into Jaguar.

  2. Use Jaguar Manager to generate source files (including method skeletons that marshal and unmarshal method calls across the network).

  3. Use Jaguar Manager to export a component's interface as a stub or ActiveX proxy to one of the client models.

  4. Use your development tool to write the business logic for your component in the source files you generated in Step 2. In addition to the methods that you want your component to have, you can include code for sharing data between component instances, returning result sets, handling errors, setting connection caches and transaction states, and making secure and unsecure intercomponent method calls.

  5. Compile and link the component source files into a shared library or dynamic link library and deploy it into the Jaguar server.


Developing clients

After deploying components, you create a client that executes the methods in the components. You can create PowerBuilder, Java (CORBA and Enterprise JavaBean), C++ (CORBA), ActiveX, and MASP clients. You can also develop PowerDynamo clients, see Chapter 4, "Using PowerDynamo with Jaguar" for more information.

In the client code, you use a client stub or proxy to invoke a component's methods. Stubs and ActiveX proxy interfaces contain the method prototypes that you include in your client source files and network marshalling code. After it has been developed and compiled, your client performs method calls across the network to the Jaguar server and executes the corresponding component methods.

Jaguar's server-side component support and client-side stub or proxy support are independent. Any Jaguar client can execute any type of component. A component of any model can execute components of another model using intercomponent calls without the use of additional gateway software.

All clients and components share a common interface repository. Component interfaces are stored in standard CORBA Interface Definition Language (IDL). Component developers can define, edit, and browse interfaces in Jaguar Manager.

Steps In general, to create Jaguar clients:

  1. Use Jaguar Manager to generate Java or C++ stubs, or ActiveX proxy interfaces that correspond to the components.

  2. Write the source files and include the stubs or import the ActiveX proxy interfaces you created with Jaguar Manager.

  3. Compile the source files.


 


Copyright © 2000 Sybase, Inc. All rights reserved.