コンストラクタ
# 新しいOracleCacheDependency(connectionString、cmdText、cmdType、cmdParams)
提供された接続文字列とクエリ文字列を使用して、OracleCacheDependencyクラスの新しいインスタンスを初期化します。 このコンストラクタは、Oracle製品のクエリ通知機能を使用するOracleCacheDependencyオブジェクトを作成するために使用されます。 クエリには次のものが含まれている必要があります。テーブル所有者の名前を含む、完全修飾テーブル名。 たとえば、データベース所有者が所有する「customers」というテーブルを参照するには、ステートメントで「dbo.customers」を参照する必要があります。
パラメーター:
| 名前 | タイプ | 詳細説明 |
|---|---|---|
connectionString |
String | 依存関係で使用される接続文字列。 |
cmdText |
String | 依存関係で使用されるcmdText |
cmdType |
Oracleコマンドタイプ | コマンドのタイプ。 |
cmdParams |
地図 | コマンドに渡されるパラメーター。 |
例:
//Initialize the Cache Cluster
let cache = await ncache.CacheManager.getCache("demoCache");
/// Notification based DBDependency
// JDBC connectionString
let connectionString = "jdbc:oracle:thin:SCOTT/host@//20.200.20.10/orcl.host.org.pk";
let commandText = "SELECT ROWID, ProductID, ProductName, UnitPrice FROM Products WHERE ProductID = 1";
// create CacheItem to with your desired object
let cacheItem = new ncache.CacheItem("OracleDependentValue");
let oracleDependency = new ncache.OracleCacheDependency(connectionString, commandText);
cacheItem.setDependency(oracleDependency);
// Inserting item into cache
await cache.add("key-1", cacheItem);
メソッド
# getCommandParams() →{地図}
Oracleコマンドに渡されるパラメータのタイプを取得します。
戻り値:
マップを返します。
- タイプ
- 地図
# getコマンドテキスト() →{文字列}
依存関係で使用されるCommandTextを取得します。
戻り値:
CommandTextを返します。
- タイプ
- String
# getコマンドタイプ() →{コマンドタイプ}
OracleDependencyに渡されるOracleコマンドのタイプを取得します。
戻り値:
Oracleコマンドのタイプを返します。
- タイプ
- コマンドタイプ
# getConnectionString() →{文字列}
データベースに接続するためにキャッシュに必要な接続文字列を取得します。
戻り値:
接続文字列を返します。
- タイプ
- String