|By Jim O'Neil||
|August 5, 2005 11:00 AM EDT||
In this article we'll discuss connectivity requirements, Informix-specific data type processing, and the use of Informix stored procedures within the PowerBuilder environment.
PowerBuilder offers developers four specific connectivity options for IBM Informix databases:
- Third-party Open Database Connectivity (ODBC) drivers
- Third-party Java Database Connectivity (JDBC) drivers
- Third-party OLE-DB providers
- The "native" driver available in the PowerBuilder Enterprise version
In this article we'll focus on the last option by discussing connectivity requirements, Informix-specific data type processing, and the use of Informix stored procedures within the PowerBuilder environment.
Connecting to Informix
The PowerBuilder native driver for Informix connectivity (IN9) is linked with the IBM Informix ESQL C product to provide connectivity to the following IBM Informix databases
- IBM Informix Dynamic Server (IDS)
- IBM Informix Standard Engine (SE)
- IBM Informix OnLine 5
PowerBuilder application developers and end users wishing to connect to an IBM Informix database server must install the IBM Informix Connect product containing the necessary files for runtime client use. IBM Informix Connect is also included as a component within the Informix Client SDK (Software Development Kit). The SDK offers additional development tools including JDBC and ODBC drivers, an OLE-DB provider, and libraries for including embedded SQL within C, C++, and Java programs.
As there is a wide range of features supported on the various IBM Informix products, not all of the topics in this article will apply to all database servers. This article is generally focused on the features provided in IBM Informix Dynamic Server, which IBM considers their offering for mission-critical applications.
Included in IBM Informix Connect is a client utility called Setnet32 (see Figure 1). This program is used to specify default values for the connectivity parameters required to establish a connection with the Informix database from that client machine. Many of the parameters that can be entered within the Setnet32 interface are also, optionally, supplied via the PowerBuilder database profile or within script by assigning values to the properties of the PowerBuilder transaction object.
Setnet32 records the configuration information within the Windows registry on the client machine, and those values are used when the analogous connection parameters are not supplied via PowerBuilder. Within Setnet32, you can actually specify all of the default parameters, including the user name and password of the client account, such that the Connect Information in the PowerBuilder Database Profile Setup (see Figure 2) can be completely empty and your connection will still succeed!
PowerBuilder Database Profile Setup for IBM Informix
By comparing the values supplied in the fields shown in Figure 1 with those in Figures 2 and 3, you can easily correlate many of the parameters supplied via Setnet32 with the PowerBuilder profile counterparts. In addition to these options, you can also use Setnet32, and specifically its Environment tab, to set a number of optional environment variables. Among those, the two most critical are:
- INFORMIXSERVER: the name of the default server (dyn2000, above)
- INFORMIXDIR: The path to the Informix Connect software
For each item entered via the PowerBuilder Database Profile painter to support a connection to an IBM Informix database server, Table 1 provides:
- A description of that item
- The corresponding property setting in the PowerBuilder transaction object (using SQLCA as the representative transaction object)
- The analogous setting within the Setnet32 interface (which is also used as the default value if not explicitly provided by your PowerBuilder database profile or script)
- The Windows registry setting where Setnet32 stores and retrieves this information (HKLM and HKCU indicate the \\HKEY_LOCAL_MACHINE and the \\HKEY_CURRENT_USER registry hives, respectively)
The specifications of protocol and service are interdependent and have a specific set of ranges and values. Consult the Administrator's Guide accompanying your IBM Informix server for details.
Database vendors often provide data types that have the same name but have different semantics from those available in PowerBuilder. Table 2 presents the IBM Informix data types and the corresponding PowerBuilder data types. Not all of the IBM Informix data types are available on all IBM Informix database products. Also, please note the PowerBuilder equivalents for each of the native database data types may or may not support the same range of values or precision.
DATETIME and TIME Data Types
IBM Informix's DATETIME type makes use of a field qualifier segment to specify the precision of the date and time values that can be stored within that field. By default, the qualifier used when creating columns using PowerBuilder's Database painter is:
DATETIME YEAR TO FRACTION(5)
which can store any date from 1/1/0001 00:00:00000 to 12/31/9999 23:59:59.99999. PowerBuilder's year range limits this span to the years 1000 to 3000; however, since PowerBuilder can support microseconds, the precision of the time is retained.
- Where Are RIA Technologies Headed in 2008?
- PowerBuilder History - How Did It Evolve?
- Creation and Consumption of Web Services with PowerBuilder
- Cloud People: A Who's Who of Cloud Computing
- DDDW Tips and Tricks
- Cloud Expo 2011 East To Attract 10,000 Delegates and 200 Exhibitors
- Working with SOA & Web Services in PowerBuilder
- Dynamically Creating DataWindow Objects
- Cloud Expo, Inc. Announces Cloud Expo 2011 New York Venue
- OLE - Extending the Capabilities of PowerBuilder