Configure JTA/JDBC coordination on platforms other than Windows

Object files are supplied. Link the appropriate one using the supplied makefile, and declare it to the queue manager using the configuration file.

For each database management system, IBM MQ provides two object files. You must link one object file to create a 32-bit switch library, and link the other object file to create a 64-bit switch library. For Db2®, the name of each object file is jdbcdb2.o and, for Oracle, the name of each object file is jdbcora.o.

You must link each object file using the appropriate makefile supplied with IBM MQ. A switch library requires other libraries, which might be stored in different locations on different systems. However, a switch library cannot use the library path environment variable to locate these libraries because the switch library is loaded by the queue manager, which runs in a setuid environment. The supplied makefile therefore ensures that a switch library contains the fully qualified path names of these libraries.

To create a switch library, enter a make command with the following format. To create a 32-bit switch library, enter the command in the /java/lib/jdbc directory of your IBM MQ installation. To create a 64-bit switch library, enter the command in the /java/lib64/jdbc directory.
make DBMS
where DBMS is the database management system for which you are creating the switch library. The valid values are db2 for Db2 and oracle for Oracle. Here is an example of a make command:
make db2
Note the following points:

  • To run 32-bit applications, you must create both a 32-bit and a 64-bit switch library for each database management system that you are using. To run 64-bit applications, you need create only a 64-bit switch library. For Db2, the name of each switch library is jdbcdb2 and, for Oracle, the name of each switch library is jdbcora. The makefiles ensure that 32-bit and 64-bit switch libraries are stored in different IBM MQ directories. A 32-bit switch library is stored in the /java/lib/jdbc directory, and a 64-bit switch library is stored in the /java/lib64/jdbc directory.
  • Because we can install Oracle anywhere on a system, the makefiles use the ORACLE_HOME environment variable to locate where Oracle is installed.
After we have created the switch libraries for Db2, Oracle, or both, you must declare them to your queue manager. If the queue manager configuration file (qm.ini) already contains XAResourceManager stanzas for Db2 or Oracle databases, you must replace the SwitchFile entry in each stanza by one of the following:

    For a Db2 database
    SwitchFile=jdbcdb2
    

    For an Oracle database
    SwitchFile=jdbcora
    

Do not specify the fully qualified path name of either the 32-bit or 64-bit switch library. Specify only the name of the library.

If the queue manager configuration file does not already contain XAResourceManager stanzas for Db2 or Oracle databases, or if you want to add additional XAResourceManager stanzas, see Administer for information about how to construct an XAResourceManager stanza. However, each SwitchFile entry in a new XAResourceManager stanza must be exactly as described previously for a Db2 or Oracle database. You must also include the entry ThreadOfControl=PROCESS.

After we have updated the queue manager configuration file, and made sure that all appropriate database environment variables have been set, we can restart the queue manager.