Python应用程序连接到InterSystemsIRIS数据库 - 使用 DB-API
连接前准备:
- Python 开发环境
- DB-API驱动:irispython wheel 文件
- Connection String
步骤:
- 安装irispython wheel 文件
pip install intersystems_irispython-3.2.0-py3-none-any.whl
- Connection String:其中import iris 用来导入iris, connection = iris.connect是connection string。connection.close()用来断开连接。
import iris def main(): connection_string = "localhost:1972/USER" username = "SQLAdmin" password = "deployment-password" connection = iris.connect(connection_string, username, password) # when finished, use the line below to close the connection # connection.close() if __name__ == "__main__": main()