![]() |
|
This section discusses the overall architecture of the Informix database server, how DataBlade modules affect database server processes, and the application programming interfaces you can use in your DataBlade modules and client applications.
Figure 1-1 on page 1-10 illustrates the following components of Informix database server architecture when it includes DataBlade modules:
The close integration of DataBlade modules with the database server means that the database server treats new, extended data types in exactly the same way that it treats its own built-in data types.
Important: You must use the Informix J/Foundation upgrade to Informix Dynamic Server 2000 to enable services that use Java. For more information about Informix J/Foundation, see the manual "Creating UDRs in Java."
DataBlade Module Programming Languages
The DataBlade Developers Kit supports the following languages for programming DataBlade modules:
For more information on programming language options and restrictions, see the DataBlade Developers Kit User's Guide.
The DataBlade Developers Kit enables you to create database objects in C. You can create user-defined routines, cast support functions, aggregates, and opaque data type support routines in C.
The code generated for C by the DataBlade Developers Kit uses DataBlade API routines to communicate with the database server. The DataBlade API is the primary API for the database server. The DataBlade API provides routines to manage database connections, send SQL command strings, process query results, manage database server events and errors, create database server routines, manage database server memory, and so on. The DataBlade API provides a subset of Informix ESQL/C and Informix GLS routines that you can use in your DataBlade module code. For more information about the DataBlade API, see the DataBlade API Programmer's Manual.
The DataBlade Developers Kit currently allows you to write opaque data type support routines in C++. You can also create ActiveX value objects to represent opaque data types on a client computer. If you want to include other database objects in your DataBlade module, the DataBlade Developers Kit allows you to code them in C or Java.
The C++ support routines use DataBlade API routines to process opaque data types in the database server. For more information about the DataBlade API, see the DataBlade API Programmer's Manual.
Important: Informix recommends that developers create DataBlade modules in C++ only for client projects and for server projects that use Dynamic Server on Windows NT only. Check the Informix Developer Network Web site at http://www.informix.com/idn for the latest recommendations on C++ programming options.
Java Language
The DataBlade Developers Kit enables you to create database objects in Java. You can create user-defined routines, cast support functions, aggregates, and opaque data type support routines in Java. You can also create Java value objects to represent opaque data types on a client computer. You cannot create Java routines that take row or collection data types.
The code generated for Java by the DataBlade Developers Kit uses Informix JDBC Driver methods to communicate with the database server. Informix JDBC Driver supports the JDBC 2.0 API. You can use the JDBC 2.0 API to create database applications in Java.
For more information on Informix JDBC Driver, see the Informix JDBC Driver Programmer's Guide.
For a complete discussion of creating user-defined routines in Java, see the manual Creating UDRs in Java.
Important: You must use the Informix J/Foundation upgrade to Informix Dynamic Server 2000 to enable services that use Java. For more information about Informix J/Foundation, see the manual "Creating UDRs in Java."
Informix Stored Procedure Language
You can use Informix Stored Procedure Language (SPL) statements to write routines, and you can store these SPL routines in the database. SPL is an extension to SQL that provides flow control, such as looping and branching. SPL routines can execute routines written in C or other external languages, and external routines can execute SPL routines.
You can use SPL routines to perform any task that you can perform in SQL and to expand what you can accomplish with SQL alone. SPL routines are parsed and optimized when they are created. The DataBlade Developers Kit enables you to include SPL statements to create routines. For more information on SPL, see the Informix Guide to SQL: Tutorial.
If you want to add user-defined routines to your Informix database server, you must understand the internal architecture of the database server and how DataBlade module routines can affect the database system. The following aspects of the internal architecture of your Informix database server are affected the most by DataBlade modules:
The internal architecture of your Informix database server contains virtual processors. Virtual processors are operating system tasks that execute requests.
Virtual processors are separated into virtual processor classes. Each of the virtual processor classes provided in the database server handles a different type of task, such as executing queries and routines, fetching data from disk, and administering network connections. You can create user-defined virtual processors to handle tasks you define.
One of the critical virtual processors is the CPU VP, which acts as a router and handles basic administrative tasks, processes certain user requests, and delegates other requests to the appropriate processor. Tasks thus participate in a highly distributed environment that is optimized for performance and scalability.
By default, all user-defined routines routines execute in the CPU VP; however, if your DataBlade module routine makes use of certain system services, you must assign it to a user-defined virtual processor. A user-defined VP is created by the system administrator and executes only those routines assigned to it. For more information about the system services that require a user-defined VP, see the Administrator's Guide for Informix Dynamic Server 2000 and the Informix Developer Network Web site at http://www.informix.com/idn.
Another important aspect of the internal architecture of your Informix database server is that virtual processors communicate with one another through shared memory. Therefore, when you write code for user-defined routines, you cannot use standard memory allocation functions. To manage memory for DataBlade modules, you must use the memory management functions provided by the DataBlade API or the JDBC 2.0 API.
See the DataBlade API Programmer's Manual or the Creating UDRs in Java manual for complete information.
Dynamic Server executes UDRs written in Java in its specialized virtual processors, called a Java virtual processor (JVP). A JVP embeds a Java virtual machine (JVM) in its code.
The JVPs are responsible for executing all UDRs written in Java. Although the JVPs are mainly used for Java-related computation, they have the same capabilities as a user-defined Vp, and they can process all types of SQL queries. This embedded VM architecture avoids the cost of shipping Java-related queries back and forth between CPU VPs and JVPs.
For more information on how the database server handles Java code, see the Creating UDRs in Java manual.
The Client Software Developer's Kit (SDK) is a set of APIs you can use to develop applications for your Informix database server; they handle communication between the database server and the client application. Client APIs allow you to write applications in the following languages:
The Client SDK provides several connectivity products for ODBC-compliant applications and a global language support API.
For a list of current APIs, see Informix Client Products Installation Guide for Microsoft Windows Environments or Informix Client Products Installation Guide for UNIX.
You can use the following types of client objects and programs with your DataBlade module applications: