creole::drivers::odbc Namespace Reference

CodeBase driver-specific behavior. More...


Namespaces

namespace  metadata
 ODBC implementation of DatabaseInfo.


Detailed Description

CodeBase driver-specific behavior.

ODBC types / type map.

ODBC Statement.

Base class for ODBC implementation of ResultSet.

ODBC implementation of ResultSet.

ODBC specific PreparedStatement functions.

ODBC IdGenerator implimenation.

This is a simple wrapper class to manage the lifetime of an ODBC result resource (returned by odbc_exec(), odbc_execute(), etc.

ODBC implementation of Connection.

ODBC implementation of a cached ResultSet.

Default class for ODBC driver-specific behavior.

Implements MySQL driver-specific behavior.

This adapter is for Sequiter's CodeBaseSQL product. It is a dBase ODBC driver. The driver only supports forward-only cursor scrolling so this adapter causes the ODBCCachedResultSet to be used.

A couple other quirks exist:

1) Cannot get blobs to work correctly. If I try writing one to a LONGVARBINARY typed field, only the first few bytes are written. This will cause the ResultSetTest::testGetBlob() test case to fail when running tests for the driver.

2) For some reason the character count is off for the ResultSetTest::testSetClob() test case _only_ when running from the command line. If I run the same test through a web server it works fine. Looks like it has something to do with line endings in Windows. The difference in file sizes is 9803 vs 10090.

3) Setting a clob field to null writes a space to the field in the table. This causes the PreparedStatementTest::testSetNull() test case to fail when running tests for the driver.

Author:
Dave Lawson <dlawson@masterytech.com>
Version:
Revision
1.3

Obviously it would be much more efficient to simply use the Creole MySQL driver. This adapter was created for the sole purpose of testing the ODBC driver.

Author:
Dave Lawson <dlawson@masterytech.com>
Version:
Revision
1.1

Author:
Dave Lawson <dlawson@masterytech.com>
Version:
Revision
1.3

In addition to limit/offset emulation, this class implements a resultset cache. This can be useful as a workaround for some ODBC drivers which lack support for reverse/absolute cursor scrolling, etc.

This class will cache rows _on-demand_. So if you only read the first couple rows of a result, then only those rows will be cached. However, note that if you call getRecordCount() or last(), the class must read and cache all available records.

The offset / limit variables are also taken into account when caching. Any rows preceding the offset value will be skipped. Caching will stop once the limit value is reached.

To use this class, create a derived ODBCAdapter class which returns an instance of ODBCCachedResultSet from the ODBCAdapter::createResultSet() method. Specify the adapter via the query portion of the Connection URL:

odbc://localhost/Driver=MySQL ODBC 3.51 Driver;Database=test?adapter=MySQL

Author:
Dave Lawson <dlawson@masterytech.com>
Version:
Revision
1.2

Author:
Dave Lawson <dlawson@masterytech.com>
Version:
Revision
1.6

) We use a separate class because the resource can be shared by both ODBCConnection and an ODBCResultSet at the same time. ODBCConnection hangs on to the last result resource to be used in its getUpdateCount() method. It also passes this resource to new instances of ODBCResultSet. At some point the resource has to be cleaned up via odbc_free_result(). Using this class as a wrapper, we can pass around multiple references to the same resource. PHP's reference counting mechanism will clean up the resource when its no longer used via ODBCResultResource::__destruct().

NOTE: I tried keeping the SQL as basic as possible in this class. If you need something more optimized, derive your own IdGenerator and use ODBCAdapter::getIdGenerator() to use it.

Author:
Dave Lawson <dlawson@masterytech.com>
Version:
Revision
1.2

Author:
Dave Lawson <dlawson@masterytech.com>
Version:
Revision
1.4

If the current ODBC driver does not support LIMIT or OFFSET natively, the methods in here perform some adjustments and extra checking to make sure that this behaves the same as RDBMS drivers using native OFFSET/LIMIT.

This class also emulates a row count if the driver is not capable of providing one natively.

NOTE: This class only works with drivers that support absolute cursor positioning (SQL_FETCH_DIRECTION = SQL_FD_FETCH_ABSOLUTE). If the driver you are using does not support reverse/absolute cursor scrolling, you should use the ODBCCachedResultSet class instead. See the documentation for ODBCCachedResultSet for instructions on how to use it.

Author:
Dave Lawson <dlawson@masterytech.com>
Version:
Revision
1.2

Author:
Dave Lawson <dlawson@masterytech.com>
Version:
Revision
1.1


Generated on Wed May 6 23:10:50 2009 for fareofficelib by  doxygen 1.5.8