Stop the services for the instance, and from a command line, install using the install3rdParty(.cmd for windows or .sh for unix).

Change to the <install_dir>\bin directory and do the following command (change .cmd to .sh for unix):

install3rdParty.cmd IBM_DBAccess 1_0 -j <path-to-jar-file>

The jar file can be placed in the bin directory or a directory of your choice. It may be removed once the install is complete. You can verify the install by viewing existence of

<install_dir>/jar/IBM_DBAccess/1_0/SCI_MapUserExit.jar

I won’t go into the details behind creating JDBC pools here, but this user exit will need a pool, to connect to the database. It’s the exact same kind of pool you’ll use for a SQL map, or (lightweight)JDBC adapter.

Once you have the pool setup, restart your services.

There’s not much to the extended rules, to execute the user exit.

1. Declare an object to call the user exit

2. Declare strings to hold the SQL statement and result

3. Initialize the variables

4. Create a string for your SQL statement

5. Execute the SQL statement

Ex:

//declare

object dbutil;

string[100] return_value, sql_string;

//initialize

dbutil = new("com.ibm.mapping.dbaccess.SqlAccess");

return_value = “”;

sql_string = “”;

//create

sql_string = "select FIELD from TABLE where OTHER_FIELD = 'VALUE'";

//execute

return_value = dbutil.executeSQL(sql_string,"Pool_Name");

The initialization line for the object needs to be exactly as shown here.

The sql_string is just a string variable, and can be created with hardcoded values as in this example, or can be created using other string variables or string fields.

The Pool_Name in the execute line, should be replaced with the actual JDBC pool name.

The return_value could also be replaced with #string_field.

That should be all you need, to take it and run with it.

If you want to execute an update/insert/delete statement, it’s the exact same as above.

The only difference is that return_value will contain the number of rows affected.

Now here’s more information than you probably want to know…

The .java used to create the .jar contains the following:

package com.ibm.mapping.dbaccess;

/*

* Created on September 13, 2013

*/

import java.sql.*; // import java.net.*;

import com.sterlingcommerce.woodstock.util.frame.Manager;

import com.sterlingcommerce.woodstock.util.frame.jdbc.JDBCService;

/* JDBCService is listed as deprecated but per support it is still in use */

Replace the "Pool Name" and "select query" with the corresponding Pool Name and query to run

As I mentioned at the beginning, customer support does not support custom user exits, so use this at your own risk. If you need additional help, you can always talk to sales about getting a consultant or ask on some of the user forums or email groups.