How do I set up isCOBOL ESQL Generator for use with Microsoft SQL Server?
Estimated Reading Time: 2 MinutesFollow these steps:
-
Compile your program with these variables set to use the Database Bridge (EasyDB) to generate bridge programs containing ESQL statements to access your Sql Server database:
iscobol.compiler.easydb=1 iscobol.compiler.easydb.sqlserver=1
-
Put the JDBC driver in the CLASSPATH
- Download the Microsoft JDBC Drivers for your version of SQL Server from http://msdn.microsoft.com/en-us/data/aa937724.aspx.
-
Open the compressed folder you downloaded and choose the .jar file you need, based on the version of Java you're using.
For instance the jdbc driver for SQL Server version 11.2 to use with Java 1.8 would be called "mssql-jdbc-11.2.0.jre8.jar". - Put this jar file in the CLASSPATH. The easiest way to do this is to put it in the %ISCOBOL%\jars folder, since this folder is automatically added to the CLASSPATH when you use the isCOBOL wrappers.
-
Create an extended file descriptor (optional)
- Compile your COBOL program that has the SELECT and FD for this file with the -efd compiler option.
-
Run your program using the correct settings in your runtime properties file
-
Set your file index to easydb, and your prefix to the default SQL Server prefix:
iscobol.file.index=easydb iscobol.easydb.prefix=srv
-
Set your JDBC driver name and URL. Here's an example:
iscobol.jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver iscobol.jdbc.url=jdbc:sqlserver://localhost:1433;user=sa;password=sa;encrypt=false;DatabaseName=master
-
We suggest you also set the ESQL internal cursor type to the SQL Server specific value of 1009, instead of the default 1007:
iscobol.jdbc.cursor.concurrency=1009
-
Set your file index to easydb, and your prefix to the default SQL Server prefix:
iscobol.ismigrate_input_file_index=vision iscobol.ismigrate_output_file_index=easydb iscobol.jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver iscobol.jdbc.url="your URL - see above step 4b"There is a video demonstration of ISMIGRATE using EasyDB here: https://youtu.be/YliamjSiuDI