ibmdb / db2drivers Goto Github PK
View Code? Open in Web Editor NEWDb2 ODBC and JSON drivers for download by users
Db2 ODBC and JSON drivers for download by users
Getting the above error code when trying to connect to a db2 database using the cli driver for macosx
I installed the Driver server package for mac osx from here https://epwt-www.mybluemix.net/software/support/trial/cst/programwebsite.wss?siteId=853&h=null&p=null
db2cli execsql -connstring "DATABASE=bludb;HOSTNAME=localhost;PORT=50000;UID=db2inst1;PWD=password"
IBM DATABASE 2 Interactive CLI Sample Program
(C) COPYRIGHT International Business Machines Corp. 1993,1996
All Rights Reserved
Licensed Materials - Property of IBM
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
SQLError: rc = 0 (SQL_SUCCESS)
SQLGetDiagRec: SQLState : S1000
fNativeError : -1042
szErrorMsg : [IBM][CLI Driver] SQL10007N Message "0" could not be retrieved. Reason code: "3".
cbErrorMsg : 83
my PATH
/Applications/dsdriver/lib:/Applications/dsdriver/lib/icc:/Applications/dsdriver/adm:/Applications/dsdriver/bin:/Users/pat/.sdkman/candidates/scala/current/bin:/Users/pat/.sdkman/candidates/sbt/current/bin:/Users/pat/.sdkman/candidates/java/current/bin:/usr/local/opt/[email protected]/bin:/usr/local/Caskroom/miniconda/base/envs/db2/bin:/usr/local/sbin:/usr/local/opt/openjdk/bin:/usr/local/Caskroom/miniconda/base/envs/flask/bin:/usr/local/Caskroom/miniconda/base/condabin:/Users/pat/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/sbin:/usr/local/opt/openjdk/bin:/usr/local/Caskroom/miniconda/base/condabin:/Users/pat/bin:/Users/pat/.local/bin:/usr/local/opt:/Users/pat/.sdkman/candidates
my DYLD_LIBRARY_PATH
/Applications/dsdriver/lib:/Applications/dsdriver/lib/icc
I can connect to the database using a python environment with ibm_db_sa with no trouble.
And most interestingly, i can fix this issue with the CLI driver by following these steps:
export DYLD_LIBRARY_PATH=
# remove this variable
export PATH=
/Users/pat/.sdkman/candidates/scala/current/bin:/Users/pat/.sdkman/candidates/sbt/current/bin:/Users/pat/.sdkman/candidates/java/current/bin:/usr/local/opt/[email protected]/bin:/usr/local/Caskroom/miniconda/base/envs/db2/bin:/usr/local/sbin:/usr/local/opt/openjdk/bin:/usr/local/Caskroom/miniconda/base/envs/flask/bin:/usr/local/Caskroom/miniconda/base/condabin:/Users/pat/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/sbin:/usr/local/opt/openjdk/bin:/usr/local/Caskroom/miniconda/base/condabin:/Users/pat/bin:/Users/pat/.local/bin:/usr/local/opt:/Users/pat/.sdkman/candidates #remove all references to the binaries and shared libraries in /Applications/dsdriver
cd /Applications/dsdriver/bin
conda activate db2
#activate my python environment where i have installed ibm_db_sa
./db2cli execsql -connstring "DATABASE=rest;HOSTNAME=localhost;PORT=50000;UID=db2inst1;PWD=password"
works
There appears to be some references to a shared library or dylib that are missing in the cli driver installation package for mac osx? Or perhaps some bug to do with the db2profile
script?
Hello,
Any plans of adding v11.5.7? If so, when can we expect it?
Downloading and extracting https://github.com/ibmdb/db2drivers/blob/main/clidriver/macos64_odbc_cli.tar.gz and executing the following:
❯ otool -L clidriver/lib/libdb2.dylib
clidriver/lib/libdb2.dylib:
libdb2.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1677.104.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/gcc/8/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.25.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
/usr/local/lib/gcc/8/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
A large part of the macOS ecosystem relies on clang being used for compiling packages.
For example, when building the python bindings from source (and very small patches of https://github.com/ibmdb/python-ibmdb/blob/master/ibm_db.c) leads to the compilation working but during runtime I get the following issue:
import: 'ibm_db'
Traceback (most recent call last):
File "/Users/runner/miniforge3/conda-bld/ibm_db_1722957211176/test_tmp/run_test.py", line 2, in <module>
import ibm_db
ImportError: dlopen(.../lib/python3.11/site-packages/ibm_db.cpython-311-darwin.so, 0x0002): Symbol not found: (__ZNKSt8__detail20_Prime_rehash_policy14_M_need_rehashEmmm)
Referenced from: '.../lib/python3.11/site-packages/clidriver/lib/libdb2.dylib'
Expected in: '/usr/lib/libstdc++.6.dylib'
It would help a lot if there was a libdb2.dylib
available that is build with clang from macOS.
I know that installing GCC via homebrew would solve this issue but this is not an option for me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.