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 );
The user name for connections in the desired cache.
The password used by connections in the desired cache.
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).
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 |
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:
A NULL value was passed for username, password, server, or con_lib.
An invalid value was passed for con_lib.
No matching cache was found.
JagCmGetCachebyUser allows you to retrieve connections that match the desired characteristic values for:
Server name
User name
Password
Connectivity library
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.
Copyright © 2005. Sybase Inc. All rights reserved. |