Retrieve the handle for the data source with the specified name.
Beginning in EAServer 6.0, all data sources allow access
by name.
JagStatus JagCmGetCachebyName ( SQLCHAR *cachename, JagCmCache *cache );
The data source name.
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.
Return value |
To indicate |
---|---|
JAG_SUCCEED |
Success. *cache is set to the address of the matching data source. |
JAG_FAIL |
Failure. |
JagCmGetCachebyName fails for the following reasons:
A NULL value was passed for cachename.
No matching data source was found.
A matching data source is installed, but the data source properties do not allow retrieval with JagCmGetCachebyName.
JagCmGetCachebyName records a message that describes the failure reason in the server log file.
JagCmGetCachebyName allows you to retrieve connections without specifying the user name, password, and other parameters that are required by the JagCmGetCachebyUser routine.
You can retrieve a data source handle with either JagCmGetCachebyUser or JagCmGetCachebyName. Calling JagCmGetCachebyName allows you to change the data source user name, password, or server properties without requiring corresponding changes to your component source code.