Open COBOL ESQL 4J (OCESQL 4J) consits of open-source Embedded SQL pre-compiler and run time libraries for opensource COBOL 4J.
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.
libcobj.jar
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.
postgresql.jar
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
$CLASSPATH
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.
win\x64\Debug
or win\x64\Release
.Open PowerShell.
Move to "dblibj" directory.
cd dblibj
Execute the following command.
sbt assembly
\x64\Release\cobj.exe
to \x64\Debug\cobj.exe
.Move to "win" directory and execute "install.ps1".
cd win
.\install.ps1
File name | Location |
---|---|
ocesql.exe | C:\ocesql4j\bin |
ocesql4j.jar | C:\ocesql4j\lib |
C:\ocesql4j\bin
to "PATH".C:\ocesql4j\lib\ocesql4j.jar
and C:\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