Phase I
|
|
|
|
|
|
|
|
|
|
10%
|
20%
|
30%
|
40%
|
50%
|
60%
|
70%
|
80%
|
90%
|
100%
|
The objective of this phase is to create classes to wrap the principle handles
used by ODBC; SQLHENV, SQLHDBC, and SQLHSTMT. This is a very thin wrapper
on the ODBC C CLI with some additional functionality (see this document)
provided for convenience and portability. The key thing is that the classes
remain a very thin wrapper and allow the developer access to all ODBC functionality
and types. Additional convenience is to be added in subsequent phase(s).
Deliverables
GNU build
|
GNU build files.
|
libODBC++.so/libODBC++a, compliment
of C++ include files
|
Class library.
|
odbc++
|
Command-line tool used to test libODBC++.
Used to submit ODBC requests.
|
doc
|
Documentation in HTML. ODBC++ developer
documentation including; specification and code documentation. Code documentation
based upon doxygen.
|
Persistent Handles
The ODBC specification states that, for example, a disconnected SQLHDBC
may not have any valid SQLHSTMT handles. ODBC++ allows a disconnected
ODBCConnection to have ODBCStatement's. This allows your code to get a statement
handle which does not change when the connection connects/disconnects.
Persistent Messages
The ODBC specification says that the ODBC sub-system must throw away error
and warning messages after each call to ODBC. ODBC++ maintains a list of any
ODBC messages in each handle wrapper; ODBCEnvironment, ODBCConnection and
ODBCStatement. Furthermore; the messages are stored in an ODBCMessage object
which knows whether it is a warning or an error. This allows your code to
report all messages leading up to an exception. Messages can be cleared at
any time.
Asynch Processing
The ODBC specification allows many of the ODBC CLI calls to be made asynchronously.
ODBC++ recognizes when it has called an ODBC CLI function asynchronously and
it will poll ODBC until the call is done. For each poll the ODBC++ class will
call a 'poll' method which, by default, does little. However; this 'poll'
method can be replaced in a derived class and subsequently allow for some
time sharing with other parts of the program. For example; the main loop in
a GUI program may be given time to process events to refresh the screen or
show a progress bar.
Threaded Execution
The Asynch option was originally created for non-threading operating systems
- presumably DOS. Threading is usually a better option. ODBC++ provides an
option to process ODBC requests on a seperate thread. This will only work
when the ODBC sub-system is thread-safe and the driver is thread-safe. In
some cases the ODBC Driver Manager will ensure that a non-thread safe driver
is protected during threaded execution.
ODBCObject
This is the base class for some key ODBC++ classes. The primary purpose of
this class is to maintain the object hierarchy to the degree required to
allow an ODBCObject based object to cleanup after itself during a delete.
ODBCEnvironment
This class wraps the SQLHENV handle. As such it provides a method to all
ODBC C calls which work on/from a SQLHENV. Each method mirrors the C syntax
except for the absence of the SQLHENV which is implied by the ODBCEnvironment
class itself.
ODBCConnection
This class wraps the SQLHDBC handle. As such it
provides a method to all ODBC C calls which work on/from a SQLHDBC. Each
method mirrors the C syntax except for the absence of the SQLHDBC which is
implied by the ODBCConnection class itself.
Handle attributes
may be set even before a SQLHDBC has been allocated. In such a case;
they are applied during the doAlloc() call.
ODBCStatement
This class wraps
the SQLHSTMT handle. As such it provides a method to all ODBC C calls which
work on/from a SQLHSTMT. Each method mirrors the C syntax except for the
absence of the SQLHSTMT which is implied by the ODBCStatement class itself.
Handle
attributes may be set even before a SQLHSTMT has been allocated. In
such a case; they are applied during the doAlloc() call.
ODBCStatementThread
This class represents a thread which has been created to allow the background
execution of an ODBCStatement request (i.e. SQLExecute).
ODBCMessage
This class is used to represent an ODBC or ODBC++ warning/error message.
ODBCEnvironment, ODBCConnection and ODBCStatement each maintain a list of
these.
NOTE:
The developer is strongly encouraged to use the class methods provided instead
of using the ODBC handles (i.e. SQLHENV) directly. This ensures that the
ODBC++ classes are aware of all activity. This is important for such things
as capturing all error messages, connection state, execution state, and,
of course, the validitity of the ODBC handle itself.
|