Solaris C++ client for accessing User Defined Types --------------------------------------------------- 1. Introduction This example illustrates the use of user defined types (UDT) in a Solaris c++ client. The example is used along with UDTExporter datablade which contains all the types that can be created using Datablade Developers Kit (DBDK). The c++ program, 'cppclient.cpp' contains code which illustrates the use of various user defined types through c++. 2. Example blade overview This example uses a datablade called UDTExporter which contains row types, collection types, opaque types, qualified types, and distinct types. The user can open the file, server/UDTExporter.ibs in Blade Smith to find out the exact definition of the different types. This datablade can be installed on the server just like any other datablade. Please refer to the DBDK user guide for more details about installation and registration. The UDTExporter datablade defines the following functions: Input: The input routine is used for inserting data into a table. It converts the data from external to internal representation. Output: The output routine is used for extracting data from a table. It converts the data from internal to external representation. Send: The server calls the send routine to convert values to the client format before sending them to the client. Receive:The receive funtion converts a value arriving from the client to the server format. 3. Example c++ program overview The c++ program demonstrates the use of the UDTs in an c++ client program. The program illustrates the following things: a) Creating tables with different kinds of user defined types like distinct types, row types, opaque types, etc. b) Inserting values into the tables. c) Retrieving values from the tables. 4. How to run the example Prerequisites: a) C++ compiler. b) Informix Universal Server, version 9.12 or later. c) Informix DBDK, version 3.50 d) Client SDK 2.02 or later In order to build the corresponding datablade, the user should copy the "server/" directory from DBDK examples directory to their Solaris server and invoke the makefile. Once the datablade is built successfully, use Blademanager to register the datablade. In order to build the c++ client, compile the c++ program, cppclient.cpp using cppclient.mak makefile and run the executable generated (cppclient) to create tables, insert values into tables, and finally to retrieve values from the tables. The source code is well commented and it illustrates the use of the UDTs. Users are recommended to walk through the source code to find out how to use UDTs through a c++ program. Summary ------- 1. Pack and install the server blade on your unix server. 11. make -f cppclient.mak // to build the unix client. 111. run cppclient by executing the command ./cppclient Note: LD_LIBRARY_PATH should have lib, lib/esql, lib/c++ & lib/dmi all concatenated. 1V. Please compre the examples results with the expected results file located in the current directory.