IBM DB2 Connections

Question:

Why can I connect to my sql db2 while using jupyter notebooks in ibm cloud but when I try to run the same connection string in ms vs code I get an error?

”’%sql ibm_db_sa://un:pw@host:port/db?security=SSL”’

(ibm_db_dbi.Error) ibm_db_dbi::Error: [IBM][CLI Driver] SQL5005C The operation failed because the database manager failed to access either the database manager configuration file or the database configuration file.r SQLCODE=-5005 (Background on this error at: http://sqlalche.me/e/dbapi) Connection info needed in SQLAlchemy format, example: postgresql://username:password@hostname/dbname or an existing connection: dict_keys([])

Asked By: cbhami

||

Answers:

Could you specify what is ms?
Also please try to reach the dba admin to verify the user account has the correct privileges to access to the database.
If you are trying to connect in remote mode from a Linux environment you will need a SSL certificate to ensure the correct connection.
And check if the instance is UP and if not try to run db2start.

In my case
I got error

SQL0332N Character conversion from the source code page "874"
to the target code page "1252" is not supported. SQLCODE=-332

I found the codepage of table is 874
and my OS is not set non-Unicode so I go to the Region setting and
I solved this by changing at ‘Language for non-Unicoded programs’
from English(United States) to Thai(Thailand)

Answered By: user20083270
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.