Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →Connect to EnterpriseDB Data from PowerBuilder
This article demonstrates how to use the CData ODBC Driver for EnterpriseDB to connect to EnterpriseDB data and execute queries in PowerBuilder.
The CData ODBC Driver for EnterpriseDB can be used from any platform or development technology that supports ODBC, including PowerBuilder. This article shows how to connect to EnterpriseDB data and execute queries from the Database Painter and controls such as the DataWindow.
Connect to EnterpriseDB as an ODBC Data Source
If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.
The following connection properties are required in order to connect to data.
- 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.
Connect Using Standard Authentication
To authenticate using standard authentication, set the following:
- 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.
Connect Using SSL Authentication
You can leverage SSL authentication to connect to EnterpriseDB data via a secure session. Configure the following connection properties to connect to data:
- SSLClientCert: Set this to the name of the certificate store for the client certificate. Used in the case of 2-way SSL, where truststore and keystore are kept on both the client and server machines.
- SSLClientCertPassword: If a client certificate store is password-protected, set this value to the store's password.
- SSLClientCertSubject: The subject of the TLS/SSL client certificate. Used to locate the certificate in the store.
- SSLClientCertType: The certificate type of the client store.
- SSLServerCert: The certificate to be accepted from the server.
Create a Profile for the ODBC Driver for EnterpriseDB
Follow the steps below to use the Database Painter tool to create a database profile based on an ODBC DSN (data source name) for EnterpriseDB. In the Database Painter, you can use wizards and the UI to work with EnterpriseDB data.
- In PowerBuilder, click Tools -> Database Painter.
- In the Objects window in the Database Painter, right-click the ODBC node and click New Profile.
- On the Connection tab, enter a name for the profile and select the EnterpriseDB DSN in the Data Source menu.
- To view and modify a table, right-click a table and then click Edit Data -> Grid.
Using EnterpriseDB Data with PowerBuilder Controls
You can use standard PowerBuilder objects to connect to ODBC data sources and execute queries. The following example shows how to retrieve EnterpriseDB data into a DataWindow. You can add the following code to the open method:
SQLCA.DBMS = "ODBC"
SQLCA.DBParm = "ConnectString='DSN=CData EnterpriseDB Source'"
CONNECT USING SQLCA;
dw_orders.SetTransObject(SQLCA);
dw_orders.Retrieve();