ibmdb / python-ibmdbsa

Automatically exported from code.google.com/p/ibm-db.ibm-db-sa
Apache License 2.0
40 stars 59 forks source link

Error connecting to db2 when Security=SSL #114

Closed dlema65 closed 1 year ago

dlema65 commented 1 year ago

Good day:

I am not sure if the problem is with this package or with ibm-db, but when trying to connect to db2 using

from sqlalchemy import create_engine

create_engine('db2+ibm_db://****:****@my_db2_instance.cloud.ibm.com:50001/mydb?Security=SSL')

it fails in .../ibm_db_sa/ibm_db.py line 200 with error TypeError: 'sqlalchemy.cimmutabledict.immutabledict' object does not support item deletion.

When connecting with

create_engine('db2+ibm_db://****:****@my_db2_instance.cloud.ibm.com:50001/mydb;Security=SSL;)

it works, but that ";Security=SSL;" is not valid in URL and the problem is that

sqlalchemy.engine.URL.create(
            driver,
            username=uid,
            password=pwd,
            host=server,
            port=port,
            database=database,
            query={'Security': 'SSL'}
)

will create a standard URL, as in the first sample instead of the second one.

Thank you so much.

bchoudhary6415 commented 1 year ago

Hello @dlema65

This is the known issue and already fixed and fixed commit is 22226c68581f4489d25a872e2ca990fd1710dae7

The solution will be delivered by next release 0.3.9

Thank you

bchoudhary6415 commented 1 year ago

Hello @dlema65 ibm_db_sa v0.3.9 is released now. Can you please check for error now? if it get resolved, we can close the issue.