CData Python Connector for DB2

Build 20.0.7745

Connecting

Connecting with a Dialect URL

A specific URL format is used to establish a connection using SQLAlchemy. For this connector, either of the following URL formats are acceptable when creating the engine:

Format 1


import sqlalchemy as orm
engine = orm.create_engine("cdata_DB2:///?Server=10.0.1.2;Port=50000;User=admin;Password=admin;Database=test")

Format 2


import sqlalchemy as orm
engine = orm.create_engine("cdata_DB2://MyUser:MyPassword@MyServer:MyPort/MyDatabase")

Copyright (c) 2021 CData Software, Inc. - All rights reserved.
Build 20.0.7745