Documentation Archive Developer
Search
[an error occurred while processing this directive] PATH  Documentation > WebObjects 4.5 > SybaseEOAdaptor Reference

Table of Contents

SybaseAdaptor


Inherits from: EOAdaptor : NSObject
Declared in: SybaseEOAdaptor/SybaseAdaptor.h




Class Description


A SybaseAdaptor represents a single connection to a Sybase database server, and is responsible for keeping login and model information, performing Sybase-specific formatting of SQL expressions, and reporting errors.

The features SybaseAdaptor adds to EOAdaptor are as follows:

The SybaseAdaptor class has these restrictions: A context can only manage one channel at a time, and the adaptor doesn't support full outer joins because the Sybase server itself doesn't support them.




Constants


SybaseAdaptor defines the following string constants for use as connection dictionary keys.


Constant Corresponding value in the connection dictionary
HOSTNAME The name of the machine on which the database server runs.
DATABASENAME The name of the database.
USERNAME The name of the user to log in as.
PASSWORD The user's password.
LC_ALL_KEY The setting to LC_ALL, which is used to specify the language and character set for server connections. On J systems this option defaults to japanese.
ENCRYPTPASSWORD Either the string "Yes" or the string "No". If the value is "Yes", the adaptor enables the System 10 password encryption feature before attempting to open a connection.
PRIMITIVE_TYPE_MAP A dictionary representing the database's primitive type map. Sybase allows user defined types in a database that map onto primitive types. For instance, you could define a user type, primary_key, and map it to int. The primitive type map dictionary would then contain the key "primary_key" with the value "int".

For more information on the connection dictionary, see "The Connection Dictionary" (page 6) in the SybaseEOAdaptor framework introduction.



Method Types


Mapping external types to internal types
+ externalToInternalTypeMap
+ primitiveTypeForExternalType:model:
Getting information from the connection dictionary
- connectionKeys
Bracketing calls to ct_connect()
- prepareEnvironmentForConnect
- resetEnvironmentAfterConnect
Callback methods
- sybaseContextDidDisconnect:
- sybaseContextWillConnect:


Class Methods



externalToInternalTypeMap

+ (NSDictionary *)externalToInternalTypeMap

Returns the mapping between each predefined external (database) type known by the adaptor to a default internal type. For information on the mapping, see the section in the SybaseEOAdaptorFramework introduction titled "Data Type Mapping" (page 9).

primitiveTypeForExternalType:model:

+ (NSString *)primitiveTypeForExternalType:(NSString *)externalType model:(EOModel *)model

Returns the primitive type on which a given custom type, defined on the server, is based.


Instance Methods



connectionKeys

- (NSArray *)connectionKeys

Returns an NSArray containing the keys in the receiver's connection dictionary. You can use this method to prompt the user to supply values for the connection dictionary.

prepareEnvironmentForConnect

- (void)prepareEnvironmentForConnect

A call to this method should precede all calls to ct_connect() to set the LC_ALL environment variable setting to the value specified in the model connection dictionary.

See Also: - resetEnvironmentAfterConnect



resetEnvironmentAfterConnect

- (void)resetEnvironmentAfterConnect

A call to this method should follow all calls to ct_connect() to set the LC_ALL environment variable setting to the value specified in the model connection dictionary.

See Also: - prepareEnvironmentForConnect



sybaseContextDidDisconnect:

- (void)sybaseContextDidDisconnect:(SybaseContext *)aSybaseContext

Callback method that is invoked after the associated Sybase context disconnects.

sybaseContextWillConnect:

- (void)sybaseContextWillDisconnect:(SybaseContext *)aSybaseContext

Callback method that is invoked just before the associated Sybase context disconnects.


Table of Contents