接続の確立
JDBC データソースの作成
Java アプリケーションから接続するJDBC データソースを作成できます。CData JDBC Driver for Airtable に基づくJDBC データソースの作成は、3つの基本ステップで構成されます。
- ドライバーのJAR ファイルをクラスパスに追加します。JAR ファイルはインストールディレクトリの[lib]サブフォルダ内にあります。.lic ファイルはJAR ファイルと同じフォルダ内に配置される必要があることに注意してください。
- ドライバークラスを入力します。次に例を示します。
cdata.jdbc.airtable.AirtableDriver
- JDBC URL を入力します。次に例を示します。
jdbc:airtable:APIKey=keymz3adb53RqsU;BaseId=appxxN2fe34r3rjdG7;TableNames=TableA,TableB,TableC;ViewNames=TableA.ViewA,TableA.ViewB,..,TableX.ViewY; or jdbc:cdata:airtable:APIKey=keymz3adb53RqsU;BaseId=appxxN2fe34r3rjdG7;TableNames=TableA,TableB,TableC;ViewNames=TableA.ViewA,TableA.ViewB,..,TableX.ViewY;
上記の2つ目の形式は、同じURL 形式を使用しているドライバー間でアプリケーションに競合がある場合は、CData ドライバーを使用していることを確認するために常に使用できます。URL は "jdbc:airtable:" または"jdbc:cdata:airtable:" のいずれかから始まり、任意の接続プロパティの名前と値のペアをセミコロン区切りで入力します。
Airtable への接続
The 本製品 requests tables and views from Airtable.Authenticate, specify a base, and specify a list of tables to connect.
- ApiKey:Log into Airtable and navigate to the Account icon in the top-right corner.Then, select Account from the dropdown menu.From the Account page, navigate to the API section.Then, click Generate API key.Set the ApiKey to the generated key.
- BaseId:同じ[API]セクションで、BaseId を特定します。この値を特定するには、https://airtable.com/api に移動してベースを選択します。In the introduction section of the Airtable documentation for the selected base, note the value specified in "The ID of this base is Id."
- TableNames:A comma-separated list of table names for the selected base in the format TableA,TableB..etc..Supply the table names exactly as they are displayed in the Airtable UI.
- ViewNames(オプション):その形式のビューのカンマ区切りリスト。 TableA.ViewA,TableA.ViewB,..etc。 これらは、UI にあるビューと同じ名前です。
Note: カラム名に'.' 文字は使用しないでください。これは、パスに基づいてカラム名を作成する際に使用され、INSERT / UPDATE ステートメントを破壊する危険性があります。すでに'.' 文字を含むカラム名が存在する場合は、PathDelimiter をカラム名に使用しない文字に設定してください。