Chapter 7 Using Adaptive Server Anywhere with EAServer


Accessing Adaptive Server Anywhere databases

To build applications that access Adaptive Server Anywhere database, you must first create components and clients.

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

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 Creating components

  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 them into EAServer.
  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 insecure intercomponent method calls.
  5. Compile and link the component source files into a shared library or dynamic link library and deploy it into EAServer.

After deploying components, you create a client that executes the methods in the components. You can create PowerBuilder, Java (CORBA and Enterprise JavaBeans), C++ (CORBA), ActiveX, MASP, and PowerDynamo clients.

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 you have developed and compiled your client, it performs method calls across the network to EAServer and executes the corresponding component methods.

EAServer's server-side component support and client-side stub or proxy support are independent. Any EAServer 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 use Jaguar Manager to define, edit, and browse the interface definitions.

Steps Creating EAServer 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.

For detailed information on creating components and clients, see the EAServer Programmer's Guide.

 


Copyright © 2002 Sybase, Inc. All rights reserved.