Why replace the IBM DB2 preprocessor?
The IBM DB2 preprocessor translates Embedded SQL code into calls to dedicated API functions written in C.
Since isCOBOL is able to call C functions, you could consider maintaining this approach and using the isCOBOL Compiler to compile the translated source file (program.cbl) instead of the original source file (program.sqb).
However, with isCOBOL you can execute Embedded SQL statements via JDBC, which is more natural with the Java core of isCOBOL.
Here is a list of advantages to discarding the IBM DB2 preprocessor in favor of a direct support of Embedded SQL via JDBC:
One step compilation
The isCOBOL Compiler understands the Embedded SQL code without the need of precompiling. You can directly compile the original source file (program.sqb).
Clearer debug
Since no code translation occurred, the isCOBOL Graphical Debugger shows the Embedded SQL code exactly as you wrote it, allowing you to monitor the host variables used in the EXEC SQL blocks.
Simpler installation
Programs generated by the IBM DB2 preprocessor require the IBM DB2 client libraries installed on the machine where the program runs. These libraries are native libraries and therefore they must be of the same architecture of the runtime system (e.g. a 64 bit isCOBOL requires a 64 bit DB2 client libraries).
When working with JDBC instead, you just need the JDBC driver library. This is usually a single jar file written in Java without native dependencies, so it is portable on every system and architecture.
Thread safety
Programs generated by the IBM DB2 preprocessor are not thread safe so it’s not advisable to use them in application server environments like the isCOBOL Thin Client or Tomcat.
JDBC drivers instead are thread safe and therefore suitable to be used in application server environments.
Portability to other RDBMS
If the COBOL application uses standard SQL rather than DB2 specific SQL syntax, you can easily run it on other RDBMS (for example MySQL, PostgreSQL or Microsoft SQL Server). Just add the proper JDBC driver library to the Classpath and adjust the value of
iscobol.jdbc.driver and
iscobol.jdbc.url configuration properties.
Programs generated by the IBM DB2 preprocessor instead are suitable only for the IBM DB2 database.