package com.sybase.jaguar.jcm; public class JCM extends Object
Provides access to JDBC connection caches that have been defined in EAServer Manager.
None. All methods are static.
byNameAllowed(String) – Determines if a cache can be retrieved by calling getCacheByName(String).
getCache(String, String, String) – Returns a reference to a connection cache with matching values for the specified user name, password, and server name.
getCacheByName(String) – Returns a reference to the connection cache with the given name.
For an introduction to the Java connection management classes, see Chapter 26, “Using Connection Management,” in the EAServer Programmer’s Guide.
Determines if a cache can be retrieved by calling getCacheByName(String).
Package |
|
Interface |
public static boolean byNameAllowed (String name) throws JException
The name of the cache of interest, as entered in EAServer 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 EAServer Manager to allow retrieval with getCacheByName(String).
You can call byNameAllowed to determine whether by-name access is allowed for a specified cache.
Returns 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
The database user name associated with the cache.
The database password associated with the cache.
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.
Chapter 4, “Database Access,” in the EAServer System Administration Guide
Returns a reference to the connection cache with the specified name.
Package |
|
Interface |
public static JCMCache getCacheByName ( String name) throws JException
The name of the cache to be retrieved, as entered in EAServer Manager.
A reference to a JCMCache instance with a matching value for name.
A JException exception is thrown if:
No cache is installed with the specified name.
A matching cache is installed, but the cache properties forbid retrieval with this method. Use getCache(String, String, String) instead.
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 EAServer Manager without requiring corresponding changes to your component source code.
In order for components to retrieve a cache with getCacheByName, the EAServer Administrator must select the “Enable cache-by-name access” option for the cache in EAServer Manager. getCacheByName throws an exception if the cache does not have this option enabled.
Chapter 4, “Database Access,” in the EAServer System Administration Guide
getCacheByName(String), getCache(String, String, String)
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |