製品をチェック

無償トライアル:

無償トライアルへ

製品の情報と無償トライアルへ:

Amazon S3 ODBC Driver

Amazon S3 ODBC Driver を使って、ODBC 接続をサポートするあらゆるアプリケーション・ツールからAmzaon S3 クラウドストレージにデータ連携。

Amazon S3 にデータベースのようにアクセス - オブジェクト、バケットにODBC インターフェースで接続。

Connect to Amazon S3 Data from PowerBuilder


This article demonstrates how to use the CData ODBC Driver for AmazonS3 to connect to Amazon S3 data and execute queries in PowerBuilder.


古川えりか
コンテンツスペシャリスト

The CData ODBC Driver for AmazonS3 can be used from any platform or development technology that supports ODBC, including Sybase PowerBuilder. This article shows how to connect to Amazon S3 data and execute queries from the Database Painter and controls such as the DataWindow.

Create a Profile for the ODBC Driver for AmazonS3

Follow the steps below to use the Database Painter tool to create a database profile based on an ODBC DSN (data source name) for AmazonS3. In the Database Painter, you can use wizards and the UI to work with Amazon S3 data.

  1. If you have not already done so, create an ODBC DSN for AmazonS3. The DSN contains the connection properties required to connect to Amazon S3 data. You can use the Microsoft ODBC Data Source Administrator to create and configure DSNs. This is the last step of installing the driver. Required connection properties are the following:
    • AccessKey
    • SecretKey

    Amazon S3 リクエストを認可するには、管理者アカウントまたはカスタム権限を持つIAM ユーザーの認証情報を入力します。AccessKey をアクセスキーID に設定します。SecretKey をシークレットアクセスキーに設定します。

    Note: AWS アカウント管理者として接続できますが、AWS サービスにアクセスするにはIAM ユーザー認証情報を使用することをお勧めします。

    尚、本製品はAmazon S3 のファイルの一覧表示やユーザー管理情報の取得用です。S3 に保管されているExcel、CSV、JSON などのファイル内のデータを読み込みたい場合には、Excel DriverCSV DriverJSON Driver をご利用ください。

    アクセスキーの取得

    IAM ユーザーの資格情報を取得するには:

    1. IAM コンソールにサインインします。
    2. ナビゲーションペインで「ユーザー」を選択します。
    3. ユーザーのアクセスキーを作成または管理するには、ユーザーを選択してから「セキュリティ認証情報」タブを選択します。

    AWS ルートアカウントの資格情報を取得するには:

    1. ルートアカウントの資格情報を使用してAWS 管理コンソールにサインインします。
    2. アカウント名または番号を選択し、表示されたメニューで「My Security Credentials」を選択します。
    3. 「Continue to Security Credentials」をクリックし、「Access Keys」セクションを展開して、ルートアカウントのアクセスキーを管理または作成します。

    AWS ロールとして認証

    多くの場合、認証にはAWS ルートユーザーのダイレクトなセキュリティ認証情報ではなく、IAM ロールを使用することをお勧めします。RoleARN を指定することでAWS ロールを代わりに使用できます。これにより、本製品は指定されたロールの資格情報を取得しようと試みます。

    (すでにEC2 インスタンスなどで接続されているのではなく)AWS に接続している場合は、ロールを引き受けるIAM ユーザーのAccessKey とSecretKey を追加で指定する必要があります。AWS ルートユーザーのAccessKey および SecretKey を指定する場合、ロールは使用できません。

    SSO 認証

    SSO 認証を必要とするユーザーおよびロールには、RoleARN およびPrincipalArn 接続プロパティを指定してください。各Identity Provider に固有のSSOProperties を指定し、AccessKey とSecretKey を空のままにする必要があります。これにより、本製品は一時的な認証資格情報を取得するために、リクエストでSSO 認証情報を送信します。

    See the help documentation for a guide to creating a Amazon S3 DSN.
  2. In PowerBuilder, click Tools -> Database Painter.
  3. In the Objects window in the Database Painter, right-click the ODBC node and click New Profile.
  4. On the Connection tab, enter a name for the profile and select the Amazon S3 DSN in the Data Source menu. The ODBC DSN, required to create the Database Profile. (Salesforce is shown.)
  5. To view and modify a table, right-click a table and then click Edit Data -> Grid.
Live data accessible from an editable grid. (Salesforce is shown.)

Using Amazon S3 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 Amazon S3 data into a DataWindow. You can add the following code to the open method:

SQLCA.DBMS = "ODBC" SQLCA.DBParm = "ConnectString='DSN=CData Amazon S3 Source'" CONNECT USING SQLCA; dw_objectsacl.SetTransObject(SQLCA); dw_objectsacl.Retrieve();