I'm trying to make connection to a Db2 database using golang. I'm using package to make connection and using the Db2 client called v10.1fp6_ntx64_odbc_cli
.
However when I see the instruction on phiggins package it suggest to rebuild package after providing few environment variables
#!/bin/bash
DB2HOME=$HOME/sqllib
export CGO_LDFLAGS=-L$DB2HOME/lib
export CGO_CFLAGS=-I$DB2HOME/include
go build .
I'm new to golang and not sure how to perform this on Windows. I tried doing it using setting up environment variable but does not work. getting error
panic: Failed to load db2cli64.dll: The specified module could not be found. goroutine 1 [running]: syscall.(*LazyProc).mustFind(0xc000060270) C:/Go/src/syscall/dll_windows.go:280 +0x5f syscall.(*LazyProc).Addr(0xc000060270, 0x64) C:/Go/src/syscall/dll_windows.go:287 +0x32 bitbucket.org/phiggins/db2cli/api.SQLAllocHandle(0x4f0001, 0x0, 0xc000071ef8, 0xc000071f00)
C:/Users/myuser/go/src/bitbucket.org/phiggins/db2cli/api/zapi_windows.go:44 +0x34 bitbucket.org/phiggins/db2cli.initDriver(0x0, 0x0) C:/Users/myuser/go/src/bitbucket.org/phiggins/db2cli/driver.go:26 +0x57 bitbucket.org/phiggins/db2cli.init.0() C:/Users/myuser/go/src/bitbucket.org/phiggins/db2cli/driver.go:52 +0x29 exit status 2
Please help me to solve this , Looking to connect to a Db2 database using golang.