今すぐお試しください!

製品の詳細CData JDBC Driver for Presto を確認して、無償評価版をダウンロード:

今すぐダウンロード

Connect to Presto Data from PowerBuilder

This article demonstrates how to access Presto data from PowerBuilder using the CData ODBC Driver for Presto.

The CData JDBC Driver for Presto is a standards-based control that can be used from any platform or development technology that supports ODBC, including Sybase PowerBuilder. This article shows how to use the CData JDBC Driver for Presto in PowerBuilder.

This article shows how to create a basic PowerBuilder application that uses the CData JDBC Driver for Presto to perform CRUD operations (create, read, update, and delete).

Connect to Presto Data from PowerBuilder

Follow the steps below to use the Database Painter tool to create a database profile based on an ODBC DSN (data source name) for Presto. You can use a database profile to save connection properties. In the Database Painter, you can graphically manipulate data as well as execute SQL queries.

  1. Add the driver JAR to the PowerBuilder classpath. Set the CLASSPATH system environment variable to the path to the driver JAR, located in the lib subfolder of the installation directory.

    Note: If you are using PowerBuilder Classic, you can also add the path to the driver JAR by clicking Tools -> System Options -> Java.

  2. Click Tools -> Database Painter.
  3. Right-click the JDBC node and click New Profile.
  4. In the Database Profile Setup dialog, enter the following:
    • Profile Name: Enter a user-friendly name for the profile.
    • Driver Name: Enter the class name of the driver, cdata.jdbc.presto.PrestoDriver
    • URL: Enter the JDBC URL. For example: jdbc:presto:Server=127.0.0.1;Port=8080;

    Presto への接続には、まずはServer およびPort を接続プロパティとして設定します。それ以外の追加項目は接続方式によって異なります。

    TLS/SSL を有効化するには、UseSSL をTRUE に設定します。

    LDAP で認証

    LDAP で認証するには、次の接続プロパティを設定します:

    • AuthScheme: LDAP に設定。
    • User: LDAP で接続するユーザー名。
    • Password: LDAP で接続するユーザーのパスワード。

    Kerberos 認証

    KERBEROS 認証を使う場合には、以下を設定します:

    • AuthScheme: KERBEROS に設定。
    • KerberosKDC: 接続するユーザーのKerberos Key Distribution Center (KDC) サービス。
    • KerberosRealm: 接続するユーザーのKerberos Realm 。
    • KerberosSPN: Kerberos Domain Controller のService Principal Name。
    • KerberosKeytabFile: Kerberos principals とencrypted keys を含むKeytab file。
    • User: Kerberos のユーザー。
    • Password: Kerberos で認証するユーザーのパスワード。
  5. To view and modify a table, right-click a table and then click Edit Data -> Grid.

Using Presto Data with PowerBuilder Controls

You can use standard PowerBuilder objects to connect to JDBC data sources and execute queries. The following example shows how to retrieve Presto data into a DataWindow. You can add the following code to the open method:

SQLCA.DBMS = "JDBC" SQLCA.AutoCommit = False SQLCA.DBParm = "Driver='cdata.jdbc.presto.PrestoDriver',URL='jdbc:presto:Server=127.0.0.1;Port=8080;"; CONNECT USING SQLCA; dw_customer.SetTransObject(SQLCA); dw_customer.Retrieve();
 
 
ダウンロード