ODBCAdaptor
Inherits from: EOAdaptor : NSObject
Declared in: ODBCEOAdaptor/ODBCAdaptor.h
Class Description
An ODBCAdaptor represents a single connection to an ODBC database server, and is responsible for keeping login and model information, performing ODBC-specific formatting of SQL expressions, and reporting errors.
ODBC (Open Data Base Connectivity) defines a standard interface that Windows applications can use to access any data source. Unlike the other Enterprise Objects Frameworks adaptors that support a single type of database, the ODBC adaptor supports any data source that has an ODBC driver. Consequently, in addition to having standard adaptor features, the ODBC adaptor also manages information relating to the driver and to the data types defined by the data source the driver supports.
The ODBCAdaptor class doesn't support nested transactions.
Constants
ODBCAdaptor defines the following string constants for use as connection dictionary keys.
Constant | Corresponding value in the connection dictionary |
dataSourceKey | The name of the data source to connect to. |
userNameKey | The name of the user to log in as. |
passwordKey | The user's password. |
connectionStringKey | The complete string used to connect to the database. If this key is present in the dictionary, dataSourceKey, userNameKey, and passwordKey are ignored. |
typeInfoKey | Information about the types supported by the driver. |
driverInfoKey | Information about driver, including the driver name, version, and so on. |
For more information on the connection dictionary, see "The Connection Dictionary" in the ODBCEOAdaptor Framework introduction.
Additionally, ODBCAdaptor defines a string constant for use as a key in an exception's userInfo dictionary.
Constant | Corresponding value in an exception's userInfo dictionary |
SQLStatesKey | An array of strings. Each string is a five character code corresponding to an ODBC SQL state. |
Method Types
- Mapping external types to internal types
- + assignExternalTypeForAttribute:
- + externalTypeForOdbcType:model:
- + getOdbcInfoWithConnectionDictionary:
- + odbcTypeForExternalType:model:
- + odbcTypeForStringRepresentation:
- + resetOdbcInfoWithConnectionDictionary:
- + stringRepresentationForOdbcType:
- Access information in the connection dictionary
- - odbcConnectionString
- + driverInfoForModel:
- + typeInfoForModel:
- - driverInfo
- - typeInfo
- Getting the default Expression Class
- - defaultExpressionClass
- Getting ODBC environment information
- - odbcEnvironment
Class Methods
assignExternalTypeForAttribute:
+ (void)assignExternalTypeForAttribute:(EOAttribute
*)attribute
driverInfoForModel:
+ (NSDictionary *)driverInfoForModel:(EOModel
*)model
See Also: + typeInfoForModel:, - driverInfo, - typeInfo
externalTypeForOdbcType:model:
+ (NSString *)externalTypeForOdbcType:(int)type
model:(EOModel *)model
getOdbcInfoWithConnectionDictionary:
+ (NSDictionary *)getOdbcInfoWithConnectionDictionary:(NSDictionary
*)connectionDictionary
ODBCAdaptor
, ODBCContext
,
and ODBCChannel
, and
connects to the database to get the information for the typeInfo
and driverInfo dictionaries.odbcTypeForExternalType:model:
+ (NSString *)odbcTypeForExternalType:(NSString
*)externalType
model:(EOModel *)model
odbcTypeForStringRepresentation:
+ (int)odbcTypeForStringRepresentation:(NSString
*)type
resetOdbcInfoWithConnectionDictionary:
+ (NSDictionary *)resetOdbcInfoWithConnectionDictionary:(NSDictionary
*)connectionDictionary
stringRepresentationForOdbcType:
+ (NSString *)stringRepresentationForOdbcType:(int)type
typeInfoForModel:
+ (NSDictionary *)typeInfoForModel:(EOModel
*)model
See Also: + driverInfoForModel:, - driverInfo, - typeInfo
Instance Methods
defaultExpressionClass
- (Class)defaultExpressionClass
driverInfo
- (NSDictionary *)driverInfo
See Also: - typeInfo
odbcConnectionString
- (NSString *)odbcConnectionString
odbcEnvironment
- (void *)odbcEnvironment
typeInfo
- (NSDictionary *)typeInfo
See Also: - driverInfo, + driverInfoForModel:, + typeInfoForModel: