Chapter 1 Java Classes and Interfaces
package com.sybase.jaguar.jcm;public class JCM extends Object
Provides access to JDBC connection caches that have been defined in Jaguar Manager.
None. All methods are static.
For an introduction to the Java connection management classes, see "Using Java Connection Manager Classes" in the Jaguar CTS Programmer's Guide.
"Using Java Connection Manager Classes" in the Jaguar CTS Programmer's Guide
Determine if a cache can be retrieved by calling getCacheByName(String).
Package |
|
Interface |
public static boolean byNameAllowed
(String name)
throws JException
name
The name of the cache of interest, as entered in Jaguar Manager.
true
if a cache is installed
with the specified name, and the cache can be retrieved with JCM.getCacheByName(String); false
otherwise.
The getCacheByName(String) method allows you to retrieve a connection cache by specifying only the cache name, rather than specifying values for the cache user name, password, and server name. However, by-name access must be enabled for the cache in Jaguar Manager in order to allow retrieval with getCacheByName(String).
You can call byNameAllowed to determine whether by-name access is allowed for a specified cache.
Return a reference to a connection cache with matching values for the specified user name, password, and server name.
Package |
|
Interface |
public static JCMCache getCache
( String user, String pwd, String server)
throws JException
user
The database user name associated with the cache.
pwd
The database password associated with the cache.
server
The database server name associated with the cache. The value should be a JDBC connection URL in the appropriate format for calls to java.sql.DriverManager.getConnection(String). The URL format depends on which JDBC driver the cache uses. See your JDBC driver documentation for more information.
A reference to a JCMCache instance with matching values for user, pwd, and server.
A JException exception is thrown if no cache with matching values exists.
The supplied values for user, pwd, and server must match the properties of an existing cache.
"Manage Connection Caches" in the Jaguar CTS System Administration Guide
Return a reference to the connection cache with the specified name.
Package |
|
Interface |
public static JCMCache getCacheByName
( String name)
throws JException
name
The name of the cache to be retrieved, as entered in Jaguar Manager.
A reference to a JCMCache instance with matching values for user, pwd, and server.
A JException exception is thrown if:
getCacheByName allows you to retrieve a connection cache by specifying only the cache name, rather than specifying values for the cache user name, password, and server name.
Using this method rather than getCache(String, String, String) allows you to change the cache user name, password, or server in Jaguar Manager without requiring corresponding changes to your component source code.
In order for components to retrieve a cache with getCacheByName, the Jaguar Administrator must select the "Enable cache-by-name access" option for the cache in Jaguar Manager. getCacheByName throws an exception if the cache does not have this option enabled.
"Manage Connection Caches" in the Jaguar CTS System Administration Guide
getCacheByName(String), getCache(String, String, String)
Copyright © 2000 Sybase, Inc. All rights reserved. |
![]() |