Go to Scriptcase store

# Connection with Informix - Linux

In Scriptcase, we have the following driver available for connecting to Informix: Informix PDO. If you are using your own pre-configured environment, the Informix extension must be enabled manually in PHP.

> NOTE: In the automatic installation of Scriptcase, the Informix PDO driver can be enabled if desired, during the installation process. If you have enabled it, just follow the steps to connect by clicking here. If you have not enabled it, see below how to enable the driver.

## Enabling driver (Automatic installation)

1 - Download SDK Informix Driver by Clicking here

2 - Go to the directory /opt/Scriptcase/v9-php81/components/drivers/ and create the following folders: IBM/informix

The full path should be: /opt/Scriptcase/v9-php81/components/drivers/IBM/informix

3 - Extract the files inside the folder informix

4 - Enter the informix folder through the terminal and run the command below

`sudo tar -xf clientsdk.4.10.FC16_672.LINUX.tar`

5 - Run the installation file using the command below:

`sudo ./installclientsdk`

6 - When entering the installation process, type 1 to accept the terms and then type the absolute path of the driver folder and press ENTER.

The absolute path must be: /opt/Scriptcase/v9-php81/components/drivers/IBM/informix as shown in the image below

7 - Then choose the features that will be installed by the installer. Choose all features as shown in the image and press ENTER to proceed

8 - Wait for the installation to complete. You should see information that the installation was completed successfully.

9 - Restart the Apache

    sudo service apachesc9php81 restart

## Enabling driver (Manual installation)

### Prerequisites

Install the dependencies below:

UBUNTU\DEBIAN | CENTOS\RHEL
--- | ---
- sudo apt-get update | - sudo yum update
- sudo apt-get install libaio1 | - sudo yum install libaio-devel
- sudo apt-get install libncurses5 | - sudo yum install libaio
- sudo apt-get install alien | - sudo yum install glibc
- sudo apt-get install gcc-multilib g++-multilib | - sudo yum install compat-libstdc++-33
- sudo apt-get install libpam0g | - sudo yum install glibc-devel
- sudo apt-get install ksh | - sudo yum install libstdc++
- sudo apt-get install unixodbc-dev unixodbc | - sudo yum install libstdc++
| - sudo yum install pam
| - sudo yum install ncurses-devel
| - sudo yum install unixODBC
| - sudo wget ftp://195.220.108.108/linux/centos/6.7/os/i386/Packages/ksh-20120801-28.el6.i686.rpm
| - sudo yum install ksh-20120801-28.el6.i686.rpm
| - sudo yum install nano

### Informix SDK Client Configuration and Installation

1 - Download the instant client SDK compatible with your operating system’s x64 or x86 architecture. Click here to access the Informix SDK Client Download page.

- x86 = 32 bits
- x64 = 64 bits

NOTE: The Informix client installation directory must be according to your architecture:

- 32 Bits: /opt/IBM/ifx
- 64 Bits: /opt/IBM/x64/informix

2 - Realize a instalação do Client SDK:

x86 Architecture | x64 Architecture
--- | ---
1 - sudo tar -xf x86_clientsdk.3.70.UC8DE.LINUX.tar | 1 - sudo tar -xf x64_clientsdk.4.10.FC6DE.LINUX.tar
2 - sudo ./installclientsdk | 2 - sudo ./installclientsdk
3 - Select 1 to accept the terms. | 3 - Select 1 to accept the terms.
4 - Select the options: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 | 4 - Select the options: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17

Proceed with completing the installation.

3 - Restart the Apache service using the following command in the terminal:

Ubuntu 20\Debian 9 or Higher | CentOS 7/8 or Higher
--- | ---
`sudo service apache2 restart` | `sudo systemctl restart httpd`

## Creating a Connection in Scriptcase

Here is how to create a connection in your Scriptcase project using the Informix database.

1 - Access any project from your Scriptcase.

2 - Click on the New Connection icon to create a connection.

or go to the Database > New Connection menu.

After that, a new page will appear with all the database connections.

3 - Select the connection Informix.

### Connection

Enter the parameters for connecting to your Informix database as follows:

- Connection Name: Set the name of your new connection. By default, Scriptcase adds the prefix conn along with the database name.

- DBMS Driver: Select the Informix Driver used to connect. In this example we use the Informix PDO Driver.

- Server/Host (Name or IP): Enter the IP or domain of the server where the database is installed along with the access port.
  - Ex: `serverdomain.com:9088` or `192.168.254.170:9088`

- Database Name: Enter the name of your database to connect to it.

- Username: Enter the user to authenticate the connection to your Informix database.

- Password: Enter the password to complete the authentication process.

- Test Connection: Click this button to get a response from Scriptcase request to know if the parameters entered are correct.

### Filter

By accessing this tab, you can configure which items from the Database will be displayed in the connection, depending on the owner or not.

#### Show

Allows the Informix connection to see tables, views, system tables, and procedures depending on the items selected by the user. By default, the items Tables and Views are already selected by Scriptcase.

- Tables: By selecting this option, the tables in your database will be displayed.
  - By default, Scriptcase enables this option.
- Views: Selecting this option will display your database views.
  - By default, Scriptcase enables this option.

- System tables: By selecting this option, the system tables of your database will be displayed.

- Procedures: When you select this option, the procedures from your database will be displayed.

#### Searches

Allows you to define which tables and owners are displayed.

- Tables: You can define in this option which tables will be displayed. The setting can contain a `PREFIX%` or name of the tables to be displayed.
  - By default, Scriptcase leaves this option empty.
  - Ex:

- Owner: Enter the user who sees the inserted tables for display.
  - User must be in capital letters, as in the example above.
- Show: Choose whether tables are displayed for the owner entered.

> NOTE: By using table filtering, you eliminate unnecessary tables for your project and improve the performance of your database connection.

### Advanced

In this tab, you have access to connection-specific settings. Changes made in this section impact the data display and performance of the application.

- client_encoding: Select the encoding used in your database. In the example above, we used client_encoding UTF-8.

- Decimal separator: Select the type of separator for decimal records, between comma and period.
  - By default, period `.` is selected as the separator.
- Persistent connection: Set whether connections will be closed after your scripts run in Scriptcase applications.
  - By default, Scriptcase disables this option.
- Use schema before table name: Set whether the database schema is displayed before table names.

  - By default, Scriptcase enables this option.

  - Ex:

### SSH

Here are the SSH options available in the image and their descriptions regarding database connection:

#### Use SSH

Enables or disables the SSH tunnel for database connection. When enabled, the database connection will be routed through the SSH server.

#### SSH Server

The IP address or hostname of the SSH server that will be used for tunneling. This is the machine that will act as a bridge to access the database securely.

#### SSH Port

The port used to connect to the SSH server.

#### SSH User

The username used to authenticate with the SSH server. This user must have permissions to establish an SSH connection.

#### Authentication method

You can choose two options: password or certificate. When you choose one of the options, a new field will appear below for the configuration.

#### Private cert. file

The private key file used for authentication if the SSH server requires key-based authentication instead of a password.

#### Local port for port forwarding

The local port on the client machine that will be used for forwarding database traffic through the SSH tunnel. This port acts as a bridge between the database client and the remote database.

#### Database server from SSH

The hostname or IP address of the database server as seen from the SSH server. This is necessary when the database is only accessible within the SSH server’s network.

#### Database port from SSH

The port of the database server that will be accessed through the SSH tunnel. This should match the database service’s listening port.