Go to Scriptcase store

# Connection with Informix - Windows

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: On automatic Scriptcase installation, the Informix PDO driver is already enabled. Just follow the steps to connect by clicking here.

## Prerequisites

If you are using a manual installation on Windows, you will need to enable the Informix extension in the php.ini file and install the Client SDK. See below for how to do this.

- 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

### Informix SDK Client Installation

1 - Unzip the file into any folder.

- Example: `client informix`

2 - Access your windows CMD by searching for command prompt in Windows search or by pressing ctrl+r and typing `cmd` in execute.

3 - When starting CMD, access the folder where the file was saved after downloading using the cd command and entering the path to the folder the SDK client is in. Example:

4 - Then run the .exe file with the `-i` and `GUI` parameters.

- Example: `installclientsdk.exe -i GUI`

5 - Follow the client installation wizard by clicking next to keep the default values for the installation. Pay attention to the Security Features step.

6 - Here you can choose whether or not to use a password to access the OAT (Informix Administration Application)

7 - Set your login and password, if you have checked the OAT password protection option

8 - Select NO and proceed with the installation as usual.

9 - Proceed with the installation by clicking on Done and wait for the process to finish.

### Setting `php.ini`.

1 - In the `php.ini` file, located under `C:\php`, uncomment the line for the Informix extension php_pdo_informix by removing the `;` from the start of the line. See the example below:

2 - Restart the Apache service using the Task Manager.

- Open Task Manager and click on the Services tab.

- Look for the `Apache2.4` or `ApacheScriptcase9php73` service and right-click on this service, then Restart.

## 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.