com.alachisoft.ncache.runtime.dependencies
Class SqlCacheDependency
java.lang.Object
com.alachisoft.ncache.runtime.dependencies.CacheDependency
com.alachisoft.ncache.runtime.dependencies.SqlCacheDependency
- All Implemented Interfaces:
- java.io.Serializable
public final class SqlCacheDependency
- extends CacheDependency
Establishes a relationship between an item stored in an application's Cache object
and either a row in a specific SQL Server database table or
the results of a SQL Server 2005 query.
You can add items with dependencies to your application's cache with the
"Cache.Add" and Insert methods.
When you add an item to an application's "Cache" object with "SqlCacheDependency" , on all supported versions of SQL Server (7.0, 2000, 2005), it monitors a
row in a specific SQL Server database table so that when that row changes, items associated with
the row will be automatically removed from the Cache.
time it is inserted into the "Cache". "SqlCacheDependency" class supports the association of cached items with a SQL Server query when SQL Server 2005 is used.
- See Also:
Cache#add(java.lang.String, com.alachisoft.ncache.web.caching.CacheItem)
,
Cache
,
SqlCacheDependency
,
Serialized Form
Constructor Summary |
SqlCacheDependency(java.lang.String connectionString,
java.lang.String cmdText)
Initializes a new instance of the SqlCacheDependency class,
using the supplied connection string and query string. |
SqlCacheDependency(java.lang.String connectionString,
java.lang.String cmdText,
SqlCommandType cmdType,
java.util.HashMap<java.lang.String,SqlCmdParams> cmdParams)
Initializes a new instance of the SqlCacheDependency class,
using the supplied connection string and query string. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SqlCacheDependency
public SqlCacheDependency(java.lang.String connectionString,
java.lang.String cmdText)
- Initializes a new instance of the SqlCacheDependency class,
using the supplied connection string and query string.
This constructor is used to create SqlCacheDependency objects that use the
query-notification feature of SQL Server 2005 products.
SQL query must include the following:
Fully qualified table names, including the name of the table owner.
For example, to refer to a table called "customers" that is owned by the database owner,
the SQL statement must refer to "dbo.customers".
Explicit column names in the Select statement.
You cannot use the asterisk (*) wildcard character to select all columns from a table.
For example, instead of "select * from customers", you must use
"select name, address, city, state from dbo.customers".
- Parameters:
connectionString
- connection string to be used by dependency.cmdText
- cmdText to be used by dependency.
SqlCacheDependency
public SqlCacheDependency(java.lang.String connectionString,
java.lang.String cmdText,
SqlCommandType cmdType,
java.util.HashMap<java.lang.String,SqlCmdParams> cmdParams)
- Initializes a new instance of the SqlCacheDependency class,
using the supplied connection string and query string.
This constructor is used to create SqlCacheDependency objects that use the
query-notification feature of SQL Server 2005 products.
SQL query must include the following:
Fully qualified table names, including the name of the table owner.
For example, to refer to a table called "customers" that is owned by the database owner,
the SQL statement must refer to "dbo.customers".
Explicit column names in the Select statement.
You cannot use the asterisk (*) wildcard character to select all columns from a table.
For example, instead of "select * from customers", you must use
"select name, address, city, state from dbo.customers".
- Parameters:
connectionString
- connection string to be used by dependency.cmdText
- cmdText to be used by dependency.cmdType
- The type of the command. (text/stored procedure)cmdParams
- Parameters to be passed to the command.
getCommandParams
public java.util.HashMap<java.lang.String,SqlCmdParams> getCommandParams()
getCommandText
public java.lang.String getCommandText()
getCommandType
public CommandType getCommandType()
getConnectionString
public java.lang.String getConnectionString()