JagCmGetCachebyName

Description

Retrieve the handle for the data source with the specified name.

NoteBeginning in EAServer 6.0, all data sources allow access by name.

Syntax

JagStatus JagCmGetCachebyName (
        SQLCHAR      *cachename,
        JagCmCache   *cache
        );

Parameters

cachename

The data source name.

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.

JagCmGetCachebyName fails for the following reasons:

JagCmGetCachebyName records a message that describes the failure reason in the server log file.

Usage

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.

See also

JagCmGetCachebyUser