Setting up Informix connection

 

You can use an existing Informix database to work with Lycia or you can create a new one. Here are the simple steps which can be used to create an Informix database and to connect to it using Lycia.

 

Step 1

Install Informix SDK Client (refer here for details)

 

Step 2

Create your Informix database using the DBaccess tool:

 

 

Step 3

Install Informix Client SDK:

  • use the Setnet32 tool to set up the server and make it the default server at the 'Server Information' tab;

  • set up the host at the 'Host Information' tab. The user name and the password must be valid on the database server specified. It is advisable not to use the username that does not require password for security reasons;

  • in the "Environment" tab set the INFORMIXSERVER variable to the name of the server you have specified as default (the value for INFORMIXSERVER should match one of the servers listed in the file $INFORMIXDIR/etc/sqlhosts);

  • save and close.

 

Step 4

Record the database connection details into the database.cfg file

 

Step 5

Set the environment variables in the inet.env file for the GUI server configuration.

 

The inet.env file can be opened and edited from within the Studio. To open it in Lycia Studio:

  • start the Studio;

  • go to Window-> Preferences -> 4GL -> Run/Debug -> GUI Servers;

  • select the GUI server from the list and press the Edit Environment button. The file will be opened in the editor area of the Studio;

  • set the variables.

 

Since the login and password will be stored in plain text, it is advisable not to set them in the inet.env file, but to pass to the program at runtime by means of the CONNECT TO statement.

 

Step 6  

(optional)

Set the database driver to "informix" as described here

 

Step 7

Restart LyciaStudio using the File -> Restart main menu option. LyciaStudio loads the environment variables from the files when it is started, they are not modified dynamically. Thus each modification of the environment variables influencing Lycia Studio functioning must be followed by the Studio restart. If you are working in the Lycia Command Line environment, you do not need to restart it after having set the variables

 

 

 

 

Step 1

Install Informix SDK Client (refer here for details)

 

Step 2

Create your Informix database using the DBaccess tool:

 

 

Step 3

Set the Lycia process environment variables. The values of the variables will be used in case if the database settings will not be found in the database.cfg file:

  • INFORMIXSERVER  = should match one of the servers listed in the file $INFORMIXDIR/etc/sqlhosts;

  • INFORMIXDIR = should point to the base location of the Informix client directory;

  • duplicate the settings for the variables in the env.properties file. The latter is located in $LYCIA_DIR\LyciaIDE\etc directory (the values of the variables will be used only if the database will not be found in the database.cfg file)

INFORMIXDIR=/opt/IBM/informix (default path for )

PATH=/opt/IBM/informix/bin:$PATH

LD_LIBRARY_PATH=/opt/IBM/informix/lib:/opt/IBM/informix/lib/esql:$LD_LIBRARY_PATH

INFORMIXSERVER=server_name

LOGNAME=login

INFORMIXPASS=password

 

Step 4

Record the database connection details into database.cfg file

 

Step 5

If you use the GUI server, set the same environment variables (specified in step 3) in the inet.env file. The inet.env file can be opened and edited from within the Studio. To open it in Lycia Studio:

  • start the Studio;

  • go to Window -> Preferences -> 4GL -> Run/Debug -> GUI Servers;

  • select the GUI server from the list and press the Edit Environment button. The file will be opened in the editor area of the Studio;

  • set the variables

 

Step 6

Set the database driver to "informix" as described here

 

 

 

Connecting to a database in GUI mode is rather tricky, if your application is running on an application server without authentication (i.e. default).

An application using this post is run as the service owner (Querix product owner) and this means that all database connections are using the same user ID. The Informix database bases the authentication on the user ID of the process, thus it is advisable to use the full authentication port (secure).