ODBCContext

Inherits From:
EOAdaptorContext : NSObject

Declared in: ODBCEOAdaptor/ODBCContext.h

Class Description

An ODBCContext represents a single transaction scope on the database server to which its adaptor object is connected. If the server supports multiple concurrent transaction sessions, the adaptor may have several adaptor contexts. An ODBCContext may in turn have several ODBCChannels, which handle actual access to the data on the server.

The features the ODBCContext class adds to EOAdaptorContext are methods for managing ODBC connections and for getting information about the driver.

Managing a connection
- odbcConnect
- odbcDisconnect
Setting the ODBC Database Connection Handle (HDBC)
- setOdbcDatabaseConnection
- odbcDatabaseConnection
Getting the transacation nesting level
- transactionNestingLevel

Instance Methods

odbcConnect

- (void)odbcConnect

Opens a connection to the database server. OracleChannel sends this message to OracleContext when it (OracleChannel) is about to open a channel to the server.

odbcDatabaseConnection

- (void *)odbcDatabaseConnection

Returns the ODBC Database Connection Handle (HDBC) as a void*; you must cast it to HDBC to work with it.

See also: - setOdbcDatabaseConnection

odbcDisconnect

- (void)odbcDisconnect

Closes the connection to the database server. OracleChannel sends this message to OracleContext when it (OracleChannel) has just closed a channel to the server.

setOdbcDatabaseConnection

- (void)setOdbcDatabaseConnection:(void *)odbcDatabaseConnection

Sets to odbcDatabaseConnection the ODBC Database Connection Handle (HDBC). You can invoke this method from the delegate method adaptorContextShouldConnect: to set up a connection in an alternative way (by using SQLBrowseConnect(), for example).

See also: - odbcDatabaseConnection

transactionNestingLevel

- (unsigned)transactionNestingLevel

Returns the number of transactions in progress. Since transactions can't be nested in the ODBC adaptor, this number is always either 0 or 1.

Copyright © 1997, Apple Computer, Inc. All rights reserved.