package com.sybase.jaguar.jcm; public class JCM extends Object
Provides access to JDBC data sources.
None. All methods are static.
byNameAllowed(String) – Determines if a data source can be retrieved by calling getCacheByName(String).
getCache(String, String, String) – Returns a reference to a data source with matching values for the specified user name, password, and server name.
getCacheByName(String) – Returns a reference to the data source with the given name.
Determines if a data source can be retrieved by calling getCacheByName(String).
Beginning in EAServer 6.0, all data sources allow access
by name. This method is provided for backward compatibility.
Package |
|
Interface |
public static boolean byNameAllowed (String name) throws JException
The name of the data source of interest.
true
if a data source
is installed with the specified name, and the data source can be
retrieved with JCM.getCacheByName(String); false
otherwise.
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.
Returns a reference to a data source 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 data source.
The database password associated with the data source.
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.
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.
The supplied values for user, pwd, and server must match the properties of an existing data source.
Chapter 4, “Database Access,” in the EAServer System Administration Guide
Returns a reference to the data source with the specified name.
Package |
|
Interface |
public static JCMCache getCacheByName ( String name) throws JException
The name of the data source to be retrieved.
A reference to a JCMCache instance with a matching value for name.
A JException exception is thrown if:
No data source is installed with the specified name.
A matching data source is installed, but the data source properties forbid retrieval with this method. Use getCache(String, String, String) instead.
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.
Beginning in EAServer 6.0, all data sources allow access
by name.
Chapter 4, “Database Access,” in the EAServer System Administration Guide