リレーションシップ・データベースへの接続を確立して、DtpConnection オブジェクトを戻します。
構文
DtpConnection getRelConnection(String relDefName)
パラメーター
戻り値
DtpConnection オブジェクトを戻します。
例外
DtpConnectionException - データベース接続の確立中にエラーが発生した場合
注記
このメソッドは、relDefName 関係で使用される関係表を含むデータベースへの接続を確立して、リレーションシップ・データベースへの照会と更新の実行を可能にします。メソッドは DtpConnection オブジェクトを戻して、それによって照会の実行およびトランザクションの管理が可能になります。詳しくは、DtpConnection クラスのメソッドを参照してください。
マップの実行が完了すると、接続が解除されます。 releaseRelConnection() メソッドを使用して、接続を明示的に閉じることができます。
例
次の例では、SapCust 関係の関係表を含むデータベースへの接続を確立します。接続が確立されると、トランザクションを使用して、SapCust 関係の中の表に行を挿入する照会を実行します。
DtpConnection connection = getRelConnection("SapCust"); // begin a transaction connection.beginTran(); // insert a row connection.executeSQL("insert..."); // update rows... connection.executeSQL("update..."); // commit the transaction connection.commit();
参照項目
getDBConnection(), DtpConnection クラス, releaseRelConnection()