Connecting to databases while defining a Transformation Map using JDBC

With MapForce version 2012 and later, you also have the alternative of creating connections via JDBC.

For maps prepared to execute as Java executable files (.JAR), it is important to note that this JDBC connection is only used inside MapForce and is not the same as the one that is used by LANSA Composer server at runtime.

To use JDBC, you will need the proper JDBC driver installed on your machine.

Finding the Right JDBC Driver

Depending on the database being used, you will need an appropriate JDBC driver. Please consult your system administrator to determine the appropriate driver to use.  For example, to connect to IBM i DB2, you would usually use the JDBC driver provided by IBM in the file jt400.jar.

Installing the JDBC Driver

Depending on how you obtained and installed the JDBC driver, no further setup may be necessary.  In the event that you start with simply the Java executable (.jar) file, then the following outlines steps you may need to complete in order to prepare your system to use the JDBC driver.

To be able to use a JDBC driver, it must first be added to the java CLASSPATH. To do this:

1.  First put it somewhere on your system e.g. C:\Drivers.

2.  Then go to Control Panel -> Systems -> Advanced.

3.  Click on Environment Variables.

System properties 01

4.  Select the CLASSPATH variable and click edit.

Environment variables 01

5.  Add the location of the JDBC driver to the path.

6.  You may need to restart your PC for the setting to take effect.

Using JDBC in MapForce

To opt to use JDBC, first you need to click JDBC Connections on the 'Select a Database' dialogue. You will then be presented with a screen similar to the following. Enter the appropriate details and you should be able to connect to the database.

For example, if you are connecting to an IBM i DB2 database and you are using the JDBC driver jt400.jar, you would be selecting the AS400JDBCDriver as below and you would probably use a connection string similar to: 'jdbc:as400://{server-name}'.

Select a database - JDBC connection

Once you have successfully connected, you can proceed to Select Database Schema and Tables in the same way as for an ODBC connection.