IBM Informix Data Source
This article includes information about how to install the Informix JDBC driver, how to connect to an Informix database, and a list of the Informix data types that supports. With the JDBC driver installed, the Informix data source is available as an option in the connection wizard when creating an API.
lac52
This article includes information about how to install the Informix JDBC driver, how to connect to an Informix database, and a list of the Informix data types that
Layer7 Live API Creator
supports. With the JDBC driver installed, the Informix data source is available as an option in the connection wizard when creating an API.In this article:
Install the Informix JDBC Driver
Copy the
ifxjdbc.jar
JAR file (the JDBC driver) into the directory that is based on the Java container on which you have installed Layer7 Live API Creator
:The self-contained, single-user version of Live API Creator that is based on Jetty
Copy the files into the
%JETTY_HOME%/caliveapicreator/lib/ext
directory.Apache Tomcat
Copy the files into the
${CATALINA_HOME}/lib
directory.Oracle WebLogic
Copy the files into the
<Your WebLogic Domain Directory>/lib
directory.JBoss/WildFly
For more information, see Install on JBoss.
IBM WebSphere
Add the JDBC driver into your Web application server.
Using the WebSphere administrative console, create a JDBC provider for the driver in the server.
For more information about how to create a JDBC provider, see the IBM WebSphere documentation.
For more information about the versions of the JDBC drivers that
Layer7 Live API Creator
supports, see Installation Requirements and Supported Platforms.Connect to an Informix Database
You can connect to your Informix database using the following methods:
- (If you have not created your API yet) When you create your API.For more information about how to create an API, see Creating APIs.
- (If you have an existing API) By adding a connection to an Informix data source.For more information about how to add a connection to a data source, see Database Connectivity.
The following procedure details how to connect to your Informix database when creating your API.
Prerequisites:
You know your JDBC connection information.Follow these steps:
- In API Creator, on the APIs page, clickCreate New API.The connection wizard opens.
- ClickDatabase Firstas the approach you want to use to create your API.
- SelectInformixas the data source.
- Complete theHost,Port, andPasswordfields, including the following fields, and then clickContinue:DatabaseThe database name. You can use double quotes ("), for example"Foo", for the database name to accept the value of mixed-case (non-standard) database names.SchemaThe schema name for this database. You can use double quotes (") for the schema name to accept the value of mixed-case (non-standard) schema names.Example:"informix"UsernameThe username that is used to connect to this database. You can use double quotes (") for the username to accept the value of mixed-case (non-standard) usernames.
You are connected to the Informix database.
The Informix data source URL contains the parameter
DELIMIDENT=y
. This parameter is required by Layer7 Live API Creator
to pass column names using single quote (') in the SQL to the database.Informix Supported Data Types
When you are setting up a connection to an external data source,
Layer7 Live API Creator
must map the data types in the data source to data types in Layer7 Live API Creator
. The following table lists the different data type mappings applicable when working with an Informix database.Layer7 Live API Creator
supports a subset of the full range of Informix data types.For more information about the Informix data types, see the Informix documentation.
Layer7 Live API Creator
supports read and write the following Informix data types:Data type | Modeled as... | Notes |
---|---|---|
bigint | number | |
bigserial | number | |
JSON and BSON | JsonType | |
byte | binary | |
char(n) | string | |
character varying | string | |
date | date | |
datetime year to fraction(n) | IntervalTimePiecesType date time timestamp |
DATE
TIMESTAMP
TIME
|
decimal | bigdecimal | |
double | number | |
float | number | |
int, int8, integer | number | |
interval year to month | IntervalYearToMonthType | Stores a span of time (or level of effort) in units of years and months .
|
interval day to fraction(n) | IntervalDaysHoursMinutesSecondsType | Stores a span of time in a contiguous set of units of days , hours , minutes , seconds , and fractions of a second .
There is a known issue with the JDBC driver handling fractions greater than -999999999-11 |
money | number | |
nchar | string | |
numeric | number | |
nvarchar | string | |
serial | number | |
smallfloat | number | |
smallint | number | |
text | string | |
varchar | string | |
boolean | boolean | |
blob/clob | binary | |
byte | binary | |
lvarchar | string | |
row | object | |
set(e) | collection | |
list(e) | collection | |
multiset(e) | collection |
Manage Database Functions and Stored Procedures
When you connect to Informix database,
Layer7 Live API Creator
scans the available stored procedures and database functions and expose them as RESTful endpoints.Layer7 Live API Creator
exposes the stored procedures that are defined as mode "O"-owner and "R"-restricted. You can define schema filters to filter out the stored procedures that you do not want to expose as REST endpoints. For more information about how to define schema filters, see Define Schema Filters.
View Database Functions and Stored Procedures
You can view the stored procedures and database functions on the Schema page in API Creator.
For more information about how to view your stored procedures, including how to invoke them, see Manage Stored Procedures.
Identify and Reference Database Functions and Stored Procedures
Database functions and stored procedures with unique names appear as the REST endpoint.
The following example shows how you can identify or reference a stored procedure in
Layer7 Live API Creator
:prefix:procname
The following example shows how you can identify or reference a database function in
Layer7 Live API Creator
:prefix:functionname
Use Overloaded Database Functions and Stored Procedures
Your Informix database can include overloaded database functions and stored procedures. The name for the overloaded database function or stored procedure appears as part of the REST endpoint. For example, it has the same name but different IN parameters.
Layer7 Live API Creator
models the overloaded database function or stored procedure names by using the database function or stored procedure name, followed by a period-separated list using the argument data type.The following examples show how you can use the
functionname
overloaded database function using the specific name argument data types:prefix:functionname.functionname-intprefix:functionname.functionname-lvarchar
The following examples show how you can use the
procname
overloaded stored procedure using the specific name argument data types:prefix:procname.procname-intprefix:procname.procname-lvarchar
Test Database Functions and Stored Procedures
Test your database functions and stored procedures in the REST Lab. Issue a POST request while passing the
IN
argument values.For more information:
- About how to test your database functions and stored procedures using the REST Lab, see Test your API Using the REST Lab.
- About how to POST to stored procedures, see Manage Stored Procedures.
Use Sequences in Informix Data Sources
Informix typically handles auto-generated primary keys using sequences, which are database objects that the sequence generator in the database uses to generate sequential values. When you connect to an Informix data source,
Layer7 Live API Creator
detects the sequences that are defined in your schema.For more information about the approaches to generating sequential values, see Associate Entities to Sequences.
Informix Data Source Limitations
The following are known limitations in Informix data sources.
Permission Denied Error When Accessing BLOB Types
You can get a permission denied error when you try to access BLOB types. To resolve this issue, consider appending the
LOBCACHE=-1
property to the end of URL in the URL
field on the Connection page.For more information about this field, see Database Connectivity.
Informix JDBC Driver Installed with Other JDBC Drivers
The Informix JDBC driver (the JAR file) and the MongoDB JDBC driver (the JAR file) reference different versions of the BSON library. These references conflict while running in
Layer7 Live API Creator
. You can install the Informix JDBC driver or the MongoDB JDBC driver, but you cannot have them installed simultaneously.For more information about this known issue, see Release Notes.