Feedback

Connection to DB2

At Scriptcase, we have the following drivers available for connection to DB2: DB2 PDO ODBC, PDO IBM, DB2, DB2 ODBC Native, DB2 ODBC Generic and DB2 ODBC Generic 6 or Below . If you are using your own, pre-configured environment , DB2 extensions must be enabled manually in PHP.

Pré-requisitos

Before proceeding with this documentation, check your PHP architecture. In order for the drivers to be enabled correctly, files must be downloaded according to the architecture used .

  • In your Scriptcase, there is the file info.php, access it by the URL: http://127.0.0.1:8091/scriptcase/info.php, where you will find the information regarding the architecture in phpinfo().

CAUTION: Download the Oracle instant client according to your PHP architecture.

PHP architecture

  • Architecture i386/i686 = 32 bits
  • Architecture x86_64 = 64 bits

Required files:

x64

x86

Configuring DB2 on Linux

The automatic installation of Scriptcase comes with IBM DB2 pre-configured, you must install only DsDriver to make the connection. Follow them steps below to correctly enable all drivers in Scriptcase.

1 - 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

2 - Install the IBM DB2 DsDriver:

ARCHITECTURE x86 ARCHITECTURE x64
- sudo mkdir -p /opt/IBM/Db2 - sudo mkdir -p /opt/IBM/Db2
- sudo cp sudo cp x86_v10.5fp8_linuxia32_dsdriver.tar.gz /opt/IBM/Db2 - sudo cp x64_v10.5fp8_linuxx64_dsdriver.tar.gz /opt/IBM/Db2
- sudo tar -zxf /opt/IBM/Db2/x86_v10.5fp8_linuxia32_dsdriver.tar.gz - sudo tar -zxf /opt/IBM/Db2/x64_v10.5fp8_linuxx64_dsdriver.tar.gz
- sudo ksh /opt/IBM/Db2/dsdriver/installDSDriver - sudo ksh /opt/IBM/Db2/dsdriver/installDSDriver

3 - Restart the Apache service:

UBUNTU\DEBIAN CENTOS\RHEL
sudo service apachesc9php73 restart ou sudo service apache2 restart sudo systemctl restart httpd

Creating a Connection in Scriptcase

See below how to create a connection in your Scriptcase project, using the enabled Driver and the DB2 database.

1 - Access a project from your Scriptcase.

2 - Click the New Connection icon to create a connection

Creating a new connection

or access the Database > New connection menu.

Creating a new connection

After that, a screen will appear with all database connections.

3 - Select the DB2 connection.

Selecting the database connection

Connection

Enter the parameters for connecting to your database as follows:

Connecting to the database

  • Connection name: Define the name of your new connection. By default, Scriptcase adds the prefix conn along with the database name.

  • DBMS Driver: Select the Driver for connection. In this example, we use Driver DB2.

  • Server/Host (Name or IP): Enter the IP or domain of the server where the database is installed.
  • EX: dominiodoserver.com or 192.168.254.170

  • Port: Enter the port to connect to DB2. By default, the defined port is 50000.

  • Database Name: Enter the name of the database you will connect to.
  • EX: SAMPLE

  • Schema: Inform the Scheme of specific tables created for the use of the informed user.
    • This item is optional if you do not have a schema configured in your database .
  • Username: Inform the user to authenticate the connection to your database.

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

  • Test connection: Click this button to get a response to the Scriptcase request to find out if the parameters entered are correct.

Testing the database connection

Filter

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

Filtering the database connection

Show


It allows the 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: Selecting this option, the tables in your database will be displayed.
    • By default, Scriptcase enables this option .
  • Views: By selecting this option, the views of your database will be displayed.
    • By default, Scriptcase enables this option .
  • System Tables: Selecting this option, the system tables of your database will be displayed.

  • Procedures: By selecting this option, the procedures of 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 configuration can contain a PREFIX%% or name of the tables to display.
    • By default, Scriptcase leaves this option empty .
    • EX:

    Example of using the prefix


  • Owner: Inform the user who sees the tables informed for display.
    • User must be capitalized as in the example above .
  • View: Choose whether tables for the informed owner are displayed.

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

Advanced

In this tab, you have access to specific settings for the connection. The settings made in this session impact the data display and application performance.

Advanced database connection configuration

  • client_encoding: Select the encoding used in your database. In the example above, we use client_encoding UTF-8.
    • By default, this option is left blank by Scriptcase .
  • Decimal Separator: Select the type of separator for decimal records, between comma and period.
    • By default, the . dot is selected as a separator .
  • Persistent Connection: Define whether connections will be closed after the execution of your scripts in Scriptcase applications.
    • By default, Scriptcase disables this option .
  • Use the schema before the table name: Define whether the database schema will be displayed before the table names.
    • By default, Scriptcase enables this option .

Questions or Connection Problems?

Contact our support in case of connection problems or questions regarding this database.