Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Connecting PostgreSQL from IBM i

Recently, my client acquired an application which uses PostgreSQL database. The main application resides on IBM i. They wanted to get the data from PostgreSQL into IBM i.

I did check, if they are open to install PostgreSQL on IBM i itself, which may save them additional infrastructure costs, but the "management" was not ready and I had no power/influence on their decision.

Long story short, they asked me to confirm if we can connect in any way.

I started on the task, downloaded Scott Klement's JDBC driver Service Program. Here are the steps I took,

  1. Downloaded type 4 JDBC driver jar from PostgreSQL server, placed it in home folder in IFS. e.g. /home/UserID/java/jdbc/POSTGRESQL-42.2.14.jar
  2. Derived their Class.forName string 'org.postgresql.Driver' from their documentation.
  3. There are few ENVVAR which needs to be set:
    • the environment variable - CLASSPATH for driver .jar file in IFS.
    • setting STDIN, STDOUT, STDERR to catch Java exceptions, also call CHECKSTDIO program to set these open More details here.
  4. RPGLE to connect and fetch the data from that server.
  5. Compiled and tested the connection. So simple!


anandkhekale  ·  GitHub @anand-khekale  ·  Twitter @anandkhekale

About

Connect PostgreSQL from IBM i

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors