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

Table of Contents

InformixAdaptor


Inherits from: EOAdaptor : NSObject
Declared in: InformixEOAdaptor/InformixAdaptor.h




Class Description


An InformixAdaptor represents a single connection to an Informix database server, and is responsible for keeping login and model information, performing Informix-specific formatting of SQL expressions, and reporting errors.

The InformixAdaptor doesn't support full outer joins.




Constants


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


Constant Corresponding value in the connection dictionary
dbNameKey The name of the database.
userNameKey The name of the user to log in as.
passwordKey The user's password.

It defines a string constant for use as a key in an exception's userInfo dictionary (see raiseInformixError:).


Constant Corresponding value in an exception's userInfo dictionary
InformixErrorKey The error code raised in the Informix server. The value is an NSNumber with the error code as its long value, typically a negative number.

InformixAdaptor also defines a string constant to identify the user defaults domain for the Informix adaptor.


Constant Description
EOF_INFORMIX_ADAPTOR The name of the user defaults domain for the Informix adaptor.



Method Types


Mapping external types to internal types
+ externalToInternalTypeMap
Getting information from the connection dictionary
- informixConnectionString
- informixDefaultForKey:
- informixPassword
- informixUserName
- connectionKeys
Error handling
- raiseInformixError:
Preparing to connect
- prepareEnvironmentForConnect
- resetEnvironmentAfterConnect
Callback methods
- informixContextDidDisconnect:
- informixContextWillConnect:
Getting adaptor-specific classes
- adaptorContextClass
- adaptorChannelClass
- defaultExpressionClass


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 InformixEOAdaptor Framework introduction titled "Data Type Mapping" .


Instance Methods



adaptorChannelClass

- (Class)adaptorChannelClass

Returns the InformixChannel class.

adaptorContextClass

- (Class)adaptorContextClass

Returns the InformixContext class.

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.

defaultExpressionClass

- (Class)defaultExpressionClass

Returns the InformixSQLExpression class.

informixConnectionString

- (NSString *)informixConnectionString

Returns the user name, password, and database name as a string suitable to be supplied as an argument to db_connect().

informixContextDidDisconnect:

- (void)informixContextDidDisconnect:(InformixContext *)logon

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

informixContextWillConnect:

- (void)informixContextWillConnect:(InformixContext *)logon

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

informixDefaultForKey:

- (NSString *)informixDefaultForKey:(NSString *)key

Returns the user default setting for key. To get this information it first checks the user defaults, and then the adaptor's internal defaults dictionary.

informixPassword

- (NSString *)informixPassword

Returns the password in the connection dictionary.

informixUserName

- (NSString *)informixUserName

Returns the user name in the connection dictionary.

prepareEnvironmentForConnect

- (void)prepareEnvironmentForConnect

Prepares the user environment for connection to an Informix server. Preserves existing environment variables, replacing them with values obtained from the adaptor's connection dictionary. Unset variables are set to values obtained from informixDefaultForKey:, if any.

See Also: - resetEnvironmentAfterConnect



raiseInformixError:

- (void)raiseInformixError:(NSString *)sqlString

Examines Informix structures for error flags and raises an exception if one is found. Extracts the error information in the connection structure and uses it to build and raise an exception. The error code is available in the exception's user info dictionary in the entry for the key, InformixErrorKey.

resetEnvironmentAfterConnect

- (void)resetEnvironmentAfterConnect

Restores any environment variables overwritten by prepareEnvironmentForConnect.


Table of Contents