The C API for DB2 is called CLI and is basically the same interface as
ODBC. However, it can be used without configuring ODBC which
simplifies usage for DB2-only projects. Basing the DB2 CLI driver on
mgodbc allows it to benefit from improvements made to mgodbc.
The following cgo environment variables must be set before building this
Here is a sample script which sets these variables:
go build .
On Linux, LD_LIBRARY_PATH probably needs to be set to find the DB2
This sample script demonstrates the bare minimum needed: