com.sybase.jaguar.jcm.JCM class

Description

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

Provides access to JDBC data sources.

Constructors

None. All methods are static.

Methods




JCM.byNameAllowed(String)

Description

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

NoteBeginning in EAServer 6.0, all data sources allow access by name. This method is provided for backward compatibility.

Syntax

Package

com.sybase.jaguar.jcm

Interface

JCM

public static boolean byNameAllowed
    (String name) 
    throws JException 

Parameters

name

The name of the data source of interest.

Returns

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

Usage

The getCacheByName(String) method allows you to retrieve a data source by specifying only the data source name, rather than specifying values for the data source user name, password, and server name.

You can call byNameAllowed to determine whether by-name access is allowed for a specified data source.

See also

getCacheByName(String)




JCM.getCache(String, String, String)

Description

Returns a reference to a data source 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 data source.

pwd

The database password associated with the data source.

server

The database server name associated with the data source. 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 data source 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 data source with matching values exists.

Usage

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

See also

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

getCacheByName(String)




JCM.getCacheByName(String)

Description

Returns a reference to the data source 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 data source to be retrieved.

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 data source by specifying only the data source name, rather than specifying values for the data source user name, password, and server name.

Using this method rather than getCache(String, String, String) removes the need to code database user names and passwords into your component source code. This method also allows you to change the data source user name, password, or server in the data source properties without requiring corresponding changes to your component source code.

NoteBeginning in EAServer 6.0, all data sources allow access by name.

See also

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

byNameAllowed(), getCache(String, String, String)