jaguar.jcm.JCM class

Description

package com.sybase.jaguar.jcm;
public class JCM extends Object 

Provides access to JDBC connection caches that have been defined in EAServer Manager.

Constructors

None. All methods are static.

Methods

Usage

For an introduction to the Java connection management classes, see Chapter 26, “Using Connection Management,” in the EAServer Programmer’s Guide.




JCM.byNameAllowed(String)

Description

Determines if a cache can be retrieved by calling getCacheByName(String).

Syntax

Package

com.sybase.jaguar.jcm

Interface

JCM

public static boolean byNameAllowed
    (String name) 
    throws JException 

Parameters

name

The name of the cache of interest, as entered in EAServer Manager.

Returns

true if a cache is installed with the specified name, and the cache can be retrieved with JCM.getCacheByName(String); false otherwise.

Usage

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.

See also

getCacheByName(String)




JCM.getCache(String, String, String)

Description

Returns a reference to a connection cache with matching values for the specified user name, password, and server name.

Syntax

Package

com.sybase.jaguar.jcm

Interface

JCM

public static JCMCache getCache
    ( String user, String pwd, String server) 
    throws JException

Parameters

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.

Returns

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.

Usage

The supplied values for user, pwd, and server must match the properties of an existing cache.

See also

Chapter 4, “Database Access,” in the EAServer System Administration Guide

getCacheByName(String)




JCM.getCacheByName(String)

Description

Returns a reference to the connection cache with the specified name.

Syntax

Package

com.sybase.jaguar.jcm

Interface

JCM

public static JCMCache getCacheByName
    ( String name) 
    throws JException 

Parameters

name

The name of the cache to be retrieved, as entered in EAServer Manager.

Returns

A reference to a JCMCache instance with a matching value for name.

A JException exception is thrown if:

Usage

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.

See also

Chapter 4, “Database Access,” in the EAServer System Administration Guide

getCacheByName(String), getCache(String, String, String)