Skip to content

mmlinaric/Modernstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modernstack

A cutting-edge project for the Database Connectivity and Access course. Because nothing says "modern" like COBOL and IBM Db2.

The Stack

  • COBOL - A language from 1959 that refuses to die
  • IBM Db2 - Because Oracle was too mainstream
  • Docker - The only thing here invented this century
  • GixSQL - An ESQL preprocessor nobody's heard of, connecting technologies that shouldn't talk to each other

How to Run

docker compose up -d
# Wait 15 minutes (most likely even more) for Db2 to remember how to start and for dependencies to compile.
docker logs cobol-app

What It Does

Connects to a database. Fetches 5 employees. Prints them. Revolutionary.

How it works

Firstly, the plan was to use the Ocesql precompiler to fetch the data. After about half an hour of debugging, I noticed that it said: Ocesql currently supports PostgreSQL database only.

So, I had two options:

  1. Use PostgreSQL (that would be too boring).
  2. Find another method of connecting to Db2, preferably via ODBC.

After spending a few more minutes on GitHub, I found the GixSQL project that allows GnuCOBOL to run with PostgreSQL, MySQL, Oracle, and SQLite, but it also mentioned ODBC.

Digging a little bit more, messing with libraries in the application's Dockerfile, I finally managed to compile GixSQL and its dependencies. Using Docker's layered caching for Dockerfiles, I could just use

docker compose up -d
docker compose logs cobol-app

to recompile the COBOL project only after the first build and make everything work.

The COBOL application is going to wait for Db2 to initialize before it fetches the data (accomplished with the depends_on directive in docker-compose.yml).

Why

This project was designed to meet the course requirement of using a non-Java language and a non-MySQL database. So, like any other sane person would do, I decided to choose COBOL and IBM Db2.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors