CData Python Connector for DB2

Build 20.0.7745

Establishing a Connection

The objects available within our connector are accessible from the "cdata.DB2" module. In order to use the module's objects directly, the module must first be imported as below:

import cdata.DB2 as mod

From there, the connect() method can be called from the connector object to establish a connection using an appropriate connection string, such as the below:

mod.connect("Server=10.0.1.2;Port=50000;User=admin;Password=admin;Database=test")

Set the following properties to connect to DB2:

  • Server: Set this to the name of the server running DB2.
  • Port: Set this to the port the DB2 server is listening on.
  • Database: Set this to the name of the DB2 database.
  • User: Set this to the username of a user allowed to access the database.
  • Password: Set this to the password of a user allowed to access the database.

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