Data Access Library for Eiffel contents structure

ODBC_ELEMENT *

This class represents the notion of basic ODBC elements, such as environment, connection and statement. As it was mentioned in the previous chapter, ODBC environment defines the context for a connection, and the connection being established, defines the context for subsequent statements.

In the terminology of DALE there are session, database and query which represent the notion of ODBC environment, connection and statement, and are presented by the SESSION, DATABASE and SIMPLE_QUERY classes respectively.

There are three important features of the ODBC_ELEMENT class that you have to keep in mind for better understanding of its effective classes. First of all, in the same moment every ODBC element can be in one of two states: attached or unattached to the corresponding parent element: database to a session, query to a database. The parent element for a session is obviously the Heaven.

The only operation is applicable to an unattached element is the attach feature which makes that element attached or triggers an error in the parent element. Sessions becomes attached always upon the attach. The counterpart of that feature is obviously the close feature which makes the element unattached.

Second, in the same moment every attached ODBC element can be in one of two states: active or inactive. It has different sense for each kind of ODBC element: session is active always; database is active when the connection has been established; query is active when it had been executed and still has the results pending.

Third common feature of all ODBC elements is a status of element, presented by the status attribute. Application can find out the current status of every attached ODBC element.


SESSION

In fact, the only reason why it may happen to deal with a SESSION object directly is when the application needs to operate transactions under several databases. See description of the TRANSACTION class for more explanation.


Copyright © Object Tools -- info@object-tools.com
Last updated: 2005/02/02 11:51:24