JagCmGetCachebyUser

Description

Retrieve a data source 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 data source.

password

The password used by connections in the desired data source.

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 data source. 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 data source is available, its handle is returned as *cache. If no matching data source exists, *cache is set to NULL.

Returns

Return value

To indicate

JAG_SUCCEED

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

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 data source is configured for a particular set of characteristic values. If no such data source is available, JagCmGetCachebyUser sets the *cache parameter to NULL. If one or more matching data sources exist, JagCmGetCachebyUser sets *cache to the handle for the first matching data source that it finds.

See JagCmGetConnection for an example that calls JagCmGetCachebyUser.

See also

JagCmGetCachebyName