接続の確立
コネクタ内で利用可能なオブジェクトは、"cdata.enterprisedb" モジュールからアクセスできます。モジュールのオブジェクトを直接使用するには、はじめに以下のようにモジュールをインポートする必要があります。
import cdata.enterprisedb as mod
そこで、コネクタオブジェクトからconnect() メソッドを呼び出すと、以下のような適切な接続文字列を使用して接続を確立できます。
mod.connect("User=postgres;Password=admin;Database=postgres;Server=127.0.0.1;Port=5444")
Connecting to EnterpriseDB
The following connection properties are required in order to connect to data.
- User: The user which will be used to authenticate with the EnterpriseDB server.
- Password: The password which will be used to authenticate with the EnterpriseDB server.
- Server: The host name or IP of the server hosting the EnterpriseDB database.
- Port: The port of the server hosting the EnterpriseDB database.
You can also optionally set the following:
- Database: The default database to connect to when connecting to the EnterpriseDB Server. If this is not set, the user's default database will be used.