There is a recent issue with Cloud Pak for Data's Jupyter Notebook. When you try to insert Pandas DataFrame from a DB2 connection, it adds the code snippet however, running the code snippet will give an error.
ProgrammingError: ibm_db_dbi::ProgrammingError: [IBM][CLI Driver] SQL10013N The specified library "GSKit Error: 2" could not be loaded. SQLSTATE=42724 SQLCODE=-10013
This issue is caused because the SSL Certificate is base 64 encoded.
You will have to decode the SSL Certificate in order to authenticate with Db2.
- You can decode the base64 encoded string in just 2 steps:
-
Import
base64
and copy the base64 encoded ssl certificate into a variableimport base64 certificate = <Your ssl certificate>
-
Decode base64 string into
bytes
and decode the bytes intoascii
. Write the decoded ssl certificate to the file.ssl_certificate_bytes = base64.b64decode(certificate) ssl_certificate = ssl_certificate_bytes.decode('ascii') ... f.write(ssl_certificate)
-
Once you have incorporated these changes you can run the code block and the Pandas DataFrame will be loaded with the Db2 table.