Chapter 5 C Routines Reference
Retrieve a cache handle for connections that use a specified set of values for server, user name, password, and connectivity library.
JagStatus JagCmGetCachebyUser (
SQLCHAR *username,
SQLCHAR *password,
SQLCHAR *server,
SQLCHAR *con_lib,
JagCmCache *cache
);
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.
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:
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 Jaguar Manager. See "Manage Connection Caches" in the Jaguar CTS System Administration Guide for details.
See JagCmGetConnection for an example that calls JagCmGetCachebyUser.
Copyright © 2000 Sybase, Inc. All rights reserved. |
![]() |