简体   繁体   English

从 Jupyter Notebook 连接到 Db2 的问题

[英]Issues connecting to Db2 from Jupyter Notebook

dsn_driver = "{IBM DB2 ODBC DRIVER}" dsn_driver = "{IBM DB2 ODBC 驱动程序}"

dsn_database = "BLUDB" # eg "BLUDB" dsn_database = "BLUDB" # 例如 "BLUDB"

dsn_port = "50000" # eg "50000" dsn_port = "50000" # 例如 "50000"

dsn_protocol = "TCPIP" # ie "TCPIP" dsn_protocol = "TCPIP" # 即 "TCPIP"

%sql ibm_db_sa://usnername:password@Hostname:Port/Database %sql ibm_db_sa://usnername:password@Hostname:Port/Database

This is resulting in the following error:Connection info needed in SQLAlchemy format, example:这导致以下错误:SQLAlchemy 格式中需要连接信息,例如:

           postgresql://username:password@hostname/dbname
           or an existing connection: dict_keys([])Can't load plugin:sqlalchemy.dialects:ibm_db_saConnection info needed in SQLAlchemy format, example:
          postgresql://username:password@hostname/dbname
           or an existing connection: dict_keys([])

If anyone can please assist on this that would be great.如果有人可以请提供帮助,那就太好了。 My problem is that I am entering the service credentials correctly in the %sql ibm_db_sa line so not sure where I am going wrong or where the error can be corrected.我的问题是我在 %sql ibm_db_sa 行中正确输入了服务凭证,所以不确定我哪里出错了或者哪里可以纠正错误。 Thank you谢谢

您需要执行%load_ext sql才能在笔记本中启用 SQL Magic。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM