Open COBOL ESQL 4J (OCESQL 4J) consits of open-source Embedded SQL pre-compiler and run time libraries for opensource COBOL 4J.
- opensource COBOL 4J
- 1.1.2 or later
- PostgreSQL
- 9.6
- 15
- OS
- Ubuntu 24.04
- Almalinux 9
- Java
- OpenJDK 11
-
PostgreSQL Database
-
opensource COBOL 4j v1.1.2 or later.
-
sbt.
See README.md of opensource COBOL 4J.
Run the following commands to download Open COBOL ESQL 4J.
curl -L -o Open-COBOL-ESQL-4j-v1.1.1.tar.gz https://github.com/opensourcecobol/Open-COBOL-ESQL-4j/archive/refs/tags/v1.1.1.tar.gz
tar zxvf Open-COBOL-ESQL-4j-v1.1.1.tar.gz
# If you don't need the downloaded file, you can delete it.
rm Open-COBOL-ESQL-4j-v1.1.1.tar.gz
You need 2 jar files.
Run the follwing commands.
cd Open-COBOL-ESQL-4j-1.1.1/
cp /usr/lib/opensourcecobol4j/libcobj.jar dblibj/lib/
If you have already installed opensource COBOL 4J, /usr/lib/opensourcecobol4j/libcobj.jar
exists.
When you run find /usr/lib/ -name libcobj.jar
, the above path should be displayed.
In addtion, run the following commands to prepare postgresql jdbc driver.
Some commands may lack permissions.
In such case, prefix them with sudo
.
# Move to the root directory of Open-COBOL-ESQL-4j
cd Open-COBOL-ESQL-4j-1.1.1/
mkdir -p /usr/lib/Open-COBOL-ESQL-4j-1.1.1/
curl -L -o /usr/lib/Open-COBOL-ESQL-4j-1.1.1/postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.2.24.jar
cp /usr/lib/Open-COBOL-ESQL-4j-1.1.1/postgresql.jar dblibj/lib
See the official Installation guide.
Run the following commands.
./configure --prefix=/usr/
make
make install
Add /usr/lib/Open-COBOL-ESQL-4j/ocesql4j.jar
and /usr/lib/Open-COBOL-ESQL-4j/postgresql.jar
to $CLASSPATH.
export CLASSPATH="$CLASSPATH":/usr/lib/Open-COBOL-ESQL-4j/ocesql4j.jar:/usr/lib/Open-COBOL-ESQL-4j/postgresql.jar
See README.md of opensource COBOL 4J.
Copy "libcobj.jar", generated by the installation of opensourcecobol4j, into "dblibj\lib". In addtion, execute the following command to prepare postgresql jdbc driver.
cd Open-COBOL-ESQL-4J
mkdir C:\ocesql4j\lib
curl -L -o C:\ocesql4j\lib\postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.2.24.jar
copy C:\ocesql4j\lib\postgresql.jar dblibj\lib
Download here and install it.
The Windows version of Open COBOL ESQL 4J uses the CL compiler included in Visual Studio 2022, so you must have Visual Studio installed beforehand.
- Download the complete set of files for opensource COBOL 4J.
- Open win/ocesql.sln with Visual Studio.
- Select "Debug" or "Release" mode.
- Click "Build" -> "Build Solution".
After the build is completed, "cobj.exe" will be created in
win\x64\Debug
orwin\x64\Release
.
-
Open PowerShell.
-
Move to "dblibj" directory.
cd dblibj
-
Execute the following command.
sbt assembly
- If you build in Debug mode, change the 5th line of "win\install.ps1" from
\x64\Release\cobj.exe
to\x64\Debug\cobj.exe
. - Open PowerShell
- Move to "win" directory and execute "install.ps1".
cd win .\install.ps1
-
Each file is placed in the following location.
File name Location ocesql.exe C:\ocesql4j\bin ocesql4j.jar C:\ocesql4j\lib -
If you want to change the location of the files, modify "install.ps1".
- Add
C:\ocesql4j\bin
to "PATH". - Add
C:\ocesql4j\lib\ocesql4j.jar
andC:\ocesql4j\lib\postgresql.jar
to "CLASSPATH".
Guidelines for contributing to Open COBOL ESQL 4J can be found in CONTRIBUTING.md. Contributors are listed in https://github.com/opensourcecobol/Open-COBOL-ESQL-4j/graphs/contributors