Talking to IBM DB2 with Golang

Zhimin Wen
2 min readAug 15, 2018

In my recent project, I need to talk to DB2 database to construct some REST API services.

First of all, we need a DB2 driver for golang program to talk to DB2. There are some previous art done by people. However it was either not actively maintained or doesn’t support on all the major platforms. I decided to use the common ODBC driver to communicate with the DB2.

Setup ODBC/CLI for DB2

Download the DB2 ODBC/CLI driver from IBM site.

--

--