Starting an SPL debugging session with Optim Development Studio

To use Optim™ Development Studio (ODS) to debug an SPL routine, you must establish a connection between the Informix® database server and the ODS client.

You can examine the runtime behavior of an SPL routine in a client debugging environment and control the flow of a debugging session, using the standard debugger interface of Optim Development Studio (ODS). The steps that follow are also valid for Optim Data Studio.

Note: SPL Routine Debugger support for the Informix database server is available in ODS 2.2.1.0 and later versions. Earlier ODS versions (like 2.2.0) support the Informix database server, but do not provide Informix SPL support nor SPL Routine Debugger support.

To begin an SPL Routine debugging session in ODS, follow these steps:

Informix server instance: start-up and configuration

To configure the Informix database server instance so that SPL routine debugging is enabled, follow these steps:

  1. Install the Informix database server product.
  2. Configure and bring up the Informix server with entries in the onconfig and sqlhosts files to support the DRDA communications protocol:
    • onconfig:
      DBSERVERNAME   ids_spldb
    • sqlhosts:
      ids_spldb   drsoctcp   ids_server_machine_name   port_number
    Note: SPL Routine Debugger support for Informix connects the database server to the client via the IBM® Data Server Driver for JDBC and SQLJ, and requires a connection that uses the Informix DRDA protocol.
  3. You must provide an sbspace where the database server can store XML messages that ODS sends to the server. The setting of the SBSPACENAME configuration parameter specifies the name of the system default sbspace. You can create a default sbspace on the database server by using the onspaces utility with the -Df "LOGGING=ON" option. This sbspace is a requirement for debugging SPL on ODS.
  4. If this is a fresh server instance, create a new database using the CREATE DATABASE statement. You will later use this database to create a Database connection in ODS to deploy and debug your SPL routines.

Routine debugger session manager start-up (optional)

In most cases, you can use the built-in session manager that ODS provides to debug your Informix SPL routines. In some situations, however, (for example, if your server machine is behind a firewall), you might need to start a session manager on a TCP/IP port that has outbound access either on the server machine or on a different machine.

To start the session manager manually, follow these steps:

  1. To start the session manager manually, use the following command to export the CLASSPATH environment variable setting:
    export CLASSPATH=${INFORMIXDIR}/bin/db2dbgm.jar:$CLASSPATH
  2. Using Java™ 1.5.0 or above and ensuring it is in the PATH environment variable run the following command, specifying your port number that the session manager will use and a pathname for the session manager log file:
    java com.ibm.db2.psmd.mgr.Daemon -port port_num -log sess_mgr_log_path

Steps in ODS to deploy and debug SPL routines

To configure ODS to deploy and debug Informix SPL routines, , follow these steps:

  1. If you are not using the built-in session manager and have started a stand-alone session manager, use menu commands to configure that option in ODS (Window > Preferences > Run/Debug > Routine Debugger > IBM DB2® screen) by choosing the "Use an already running Session manager" radio button, and providing the port number and the machine name.
  2. To configure ODS for debugging Informix SPL routines, you need to create a Database connection in the Data Source Explorer perspective in ODS. Refer to the Optim Development Studio documentation for details on how to create a Database connection.
  3. Right Click on the Database Connection > New Connection dialog box, choose Informix, and create a new database connection by choosing the appropriate version of the IBM Data Server Driver for JDBC and SQLJ for Informix from the Driver list.
  4. In the Edit Driver Definitions dialog box, open the Jar List tab and verify that it includes db2jcc4.jar. If it does not, replace db2jcc.jar with db2jcc4.jar in the Driver files: list.
  5. Refer to the Optim Development Studio documentation for details on how to Create, Deploy, and Debug SPL routines.

Now you are ready to create, deploy and debug Informix SPL routines in Optim Development Studio.