How to install and use Informix CLI with Informix SE on Linux.
This is a HOWTO document on the installation and configuration of the
Informix CLI product on Windows to connect to Informix SE on Linux.
This document is originally created by Bert Barbe and is a work in progress.
It should, however give you the most essential install information.
Special thanks to Nils Myklebust for his constructive comments.
Bert can be reached at: bert@ba.be
Overview
Version 0.9d August 27th, 1998
- What is Informix CLI
- Installing CLI and connecting to SE
- Trouble shooting
- Links to additional documentation
1 What is Informix CLI
1.1 What is CLI ?
INFORMIX-CLI basically is the Informix ODBC driver. On Windows ODBC
is used to have Windows applications connect to databases in a generic
way, without the need to have the application know about the specifics
of a certain database. It is also used on Unix however, where the same
interface is used to write applications that can connect to different
databases in the same generic way.
CLI stands for Call Level Interface. Being based on the Microsoft
Open Database Connectivity (ODBC) Specifications, it supports SQL statements
with a library of C-language calls which enables developers to dynamically
access Informix database servers without the need for an SQL preprocessor
or the recompilation of source code for each independent data source.
This document will solely discuss the installation and configuration of
CLI on Windows platforms.
1.2 Where do I get it ?
Clientsdk is a client development kit that is available for free. You
can download it from Intraware.
Clientsdk contains CLI 2.8 and Intersolv ODBC 3.0. An earlier version CLI 2.5
was sold seperately.
An overview:
- CLI 2.5 - Includes Intersolv ODBC driver, based on the ODBC 2.5 specs.
Does not suport IDS/UD extended datatypes
- CLI 2.8 - Includes informix' own odbc driver, ODBC 2.5 compliant,
support for IDS/UD extended data types (Large objects)
- Intersolv ODBC 3.0 - ODBC 3.0 compliant, does not support IDS/UD
extended datatypes.
All three versions work with Standard Engine 7.2x
1.3 How does it work ?
There are actually two parts in CLI : the ODBC driver itself and I-CONNECT.
The ODBC driver uses the I-CONNECT libraries to connect to the database.
Other ODBC drivers like OpenLink and
SequelLink use their own
middleware layer - that needs to be installed at both ends - to connect
to the database.
2 Installing CLI and connecting to SE
To connect to your Standard Engine with CLI you need to:
- configure SE for network connections
- install the CLI on the client PC
- configure SETNET on the pc to connect to SE
- editing the pc host and services files
- test the connection with ilogin
- create ODBC datasources
2.1 Configure SE for networking
To setup networking consult the SE & ESQL/C install HOWTO.
You will end up with a sqlhosts file that contains a line with protocol
sesoctcp.
Example setup on your Linux box
a) sqlhosts file (located in $INFORMIXDIR/etc/sqlhosts )
# informixserver protocol hostname service
demose_tcp sesoctcp demo se_tcp
b) /etc/hosts file
127.0.0.1 localhost
10.0.0.3 demo #our linux server hostname
c) /etc/services
se_tcp 1526/tcp
d) You have started "$INFORMIXDIR/lib/sqlexecd demose_tcp" succesfully.
Note: there is a problem that causes sqlexecd to leave zombie sqlexec process.
To avoid this problem use the nozombie program, soon to be available in the
IDN Linux corner
e) To create the stores7 database on the linux SE (we will use this later to
test the connection) :
cd to a directory where the database files will be created and run
"dbaccessdemo7"
2.2 Install CLI
Click your way through the setup program. This is rather straightforward
This will install two components I-Connect and the actual ODBC driver.
The ODBC driver uses the I-Connect libraries to connect to the Informix
Database.
2.3 Configuring Setnet
Part of the I-Connect installation is Setnet32. This is used to enter
connection parameters into the windows registry. These are basically the same
parameters that you would find on a Unix client in the Unix environment and
sqlhosts file.
When you start setnet32 you will see a control panel with four tabs:
Environment, Server information, Host information and About Setnet32
a) environment
This contains the same environment variables that you could set in the
unix environment. The environment shown is always the environment for
the default server. For a detailed explanation refer to the manuals.
b) Server information
Enter the right parameters to connect to our Linux SE
For our example this gives:
Informix Server: demose_tcp
Hostname: demo
Protocolname: sesoctcp
Service name: se_tcp
Options:
Click Make Default Server and Apply
Note: Not all versions of setnet32 will show the options field
c) Host information
Supply the host & user information. In our example this would be:
Current host: demo
User name: informix
Password option: password
Password: [informix password on host demo]
Click apply.
For the example we will connect as user informix and give the password
rightaway. Ofcourse you can enter a different use if you like.
d) About setnet32
This just gives you the version of setnet32. Click ok to finish.
2.4 Editing the pc host and services file
You need to add the linux hostname (demo) to the windows hosts file,
and the servicename (se_tcp) to the windows services file.
The default location for the windows services and hosts file is:
- on Windows 95 : c:\windows\
- on NT 4.0 : c:\winnt\system32\drivers\etc
You can edit or create them with an editor, e.g. notepad
Make sure your hosts and services file are created WITHOUT extension.
The services file needs to contain a line for the service you use for SE.
e.g.
se_tcp 1526/tcp
The hosts file needs to have an entry for the windows pc itself, and
the linux hostname. e.g.
127.0.0.1 localhost
10.0.0.2 windowspc #windows box with Informix-CLI
10.0.0.3 demo #linux box with Informix-SE
2.5 Testing the connection with ilogin
Ilogin is a program to test the connection with the database you have
just configured in setnet32. It will try to do a select on the customer
table in the stores7 database (as created by the dbaccessdemo in the SE
distribution)
Start ilogin. You'll see a empty window with a file and Help menu.
Select run from the File menu.
You'll see a popup where you can enter Server, Hostname, Servicename,
Protocolname, Username and Password. The last one, stores database
is presetto stores7. If can leave all the other fields blank. If you do the
defaults are taken from the default server you created in setnet32.
So to test these, let's just click ok.
You should now either see the contents of the customer table in the
stores7 database on your Standard Engine, or a message that it could
not find the stores7 database. If you get another message, go back to
setnet32 and check your settings
You can change stores7 to the name of another database. Although ilogin
will complain it can't find the customer table, this is enough to
make sure it has found your database.
2.6 Adding an ODBC source
You can add odbc sources with the ODBC control panel: from the start menu,
select Settings->Control panel and double click the ODBC icon.
Click the Add button from User DSN or System DSN tab and select
the INFORMIX 2.8 or INTERSOLV ODBC 3.01 driver
In the case of Informix 2.8 and our example:
Datasource name: demo_dsn
Database: stores7
Server: demose_tcp
Host: demo
Service: se_tcp
Protocol: sesoctcp
The rest of the parameters is optional, as indicated.
Click ok, and you have your own ODBC source.
You can now test it from your application.
e.g. With excel'97:
- Select menu item menu Data->Get External Data->Create new query
- This shows a popup "Choose Data Source". Here you select the datasource
we just created for se: demo_dsn
- Now you will get another popup to login to the database. Enter your
password and click ok
- The 'Query Wizard' will now pop up. Here you can select which columns
from which tables you want to see in the query. Click on the tablename
customers and then the '>' arrow to select all columns in the customer table.
Click three times next (skipping the filter and sort criteria) and finish.
- Now you will see the data in your spreadsheet.
3 Troubleshooting