Skip to main content
100%

Created on Cognitive Class Labs

✓ Published0🌍 Public
DDAVINDER
Last edited May 31, 2019
Created on May 31, 2019

This notebook demonstrates how to access and query a Db2 database from JupyterLab using the SQL magic extension (`ipython-sql`). It shows the process of loading the SQL extension, connecting to a database via a SQLAlchemy connection string (using the `ibm_db_sa` dialect), and executing SQL commands. The example includes a connection attempt with provided credentials and illustrates error handling when the connection string is malformed. The code relies on `%load_ext sql`, `%sql` for single-line queries, and `%%sql` for cell-level SQL operations.

AI-generated description

Similar vizzes