JagCmGetCachebyUser

Description

Retrieve a cache handle for connections that use a specified set of values for server, user name, password, and connectivity library.

Syntax

JagStatus JagCmGetCachebyUser (
        SQLCHAR      *username,
        SQLCHAR      *password,
        SQLCHAR      *server,
        SQLCHAR      *con_lib,
        JagCmCache   *cache
        );

Parameters

username

The user name for connections in the desired cache.

password

The password used by connections in the desired cache.

server

For ODBC connections, the ODBC data source name (as you would use to call SQLConnect). For Client-Library connections, the server name (as you would use to call ct_connect).

con_lib

A string value indicating the connectivity library used by connections in the cache. Allowable values are:

con_lib value

To indicate

“CTLIB_110”

Sybase Open Client Client-Library

“ODBC”

An ODBC implementation library

“OCI_7”

Oracle Call Interface 7.x

“OCI_8”

Oracle Call Interface 8.x

cache

The address of a JagCmCache handle. If a matching cache is available, its handle is returned as *cache. If no matching cache exists, *cache is set to NULL.

Returns

Return value

To indicate

JAG_SUCCEED

Success. *cache is set to the address of the matching cache.

JAG_FAIL

Failure.

JagCmGetCachebyUser fails for the following reasons:

Usage

JagCmGetCachebyUser allows you to retrieve connections that match the desired characteristic values for:

You can use this routine when you are not sure if a cache is configured for a particular set of characteristic values. If no such cache is available, JagCmGetCachebyUser sets the *cache parameter to NULL. If one or more matching caches exist, JagCmGetCachebyUser sets *cache to the handle for the first matching cache that it finds.

Connection caches can be created, viewed, and modified with EAServer Manager. See Chapter 26, “Using Connection Management,” in the EAServer System Administration Guide for details.

See JagCmGetConnection for an example that calls JagCmGetCachebyUser.

See also

JagCmGetCachebyName