0

I am using the %sql commands in Python to connect to Db2. The connection was established, however .close() function doesn't work to close such connection. What query can be used to check the status of the connection and close the connection afterwards?

The below code was used to establish the connection.

!pip install --force-reinstall ibm_db==3.1.0 ibm_db_sa==0.3.3
!pip uninstall sqlalchemy==1.4 -y && pip install sqlalchemy==1.3.24
!pip install ipython-sql

%load_ext sql

%sql ibm_db_sa://my-username:my-password@hostname:port/BLUDB?security=SSL 

1 Answer 1

2

You can list all active connections and close them, see the options for the ipython-sql module.

%sql -l

%sql -x yourSession
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.