creole.drivers.odbc
[ class tree: creole.drivers.odbc ] [ index: creole.drivers.odbc ] [ all elements ]

Class: ODBCCachedResultSet

Source Location: /creole/drivers/odbc/ODBCCachedResultSet.php

Class Overview

ResultSetCommon
   |
   --ODBCResultSetCommon
      |
      --ODBCCachedResultSet

ODBC implementation of a cached ResultSet.


Author(s):

Version:

  • $Revision: 1.1 $

Variables

Methods


Inherited Variables

Inherited Methods

Class: ODBCResultSetCommon

ODBCResultSetCommon::__construct()
ODBCResultSetCommon::close()
ODBCResultSetCommon::getFieldNum()
If fetchmode is FETCHMODE_ASSOC, returns the 1-based field index number for the specified column name. Otherwise returns 0 (false).
ODBCResultSetCommon::readLobData()
Reads in any unread LOB data. For long char fields, we may already have up to odbc_longreadlen() bytes in the buffer. These are passed in via the $curdata parm. For long binary fields, no data is read initially since odbc_binmode() is set to ODBC_BINMODE_PASSTHRU.
ODBCResultSetCommon::_setLimit()
This function exists to set limit after ResultSet is instantiated.
ODBCResultSetCommon::_setOffset()
This function exists to set offset after ResultSet is instantiated.

Class: ResultSetCommon

ResultSetCommon::__construct()
ResultSetCommon::absolute()
ResultSetCommon::afterLast()
ResultSetCommon::beforeFirst()
ResultSetCommon::first()
ResultSetCommon::get()
ResultSetCommon::getArray()
ResultSetCommon::getBlob()
ResultSetCommon::getBoolean()
ResultSetCommon::getClob()
ResultSetCommon::getCursorPos()
ResultSetCommon::getDate()
ResultSetCommon::getFetchmode()
ResultSetCommon::getFloat()
ResultSetCommon::getInt()
ResultSetCommon::getIterator()
ResultSetCommon::getResource()
ResultSetCommon::getRow()
ResultSetCommon::getString()
ResultSetCommon::getTime()
ResultSetCommon::getTimestamp()
ResultSetCommon::isAfterLast()
ResultSetCommon::isBeforeFirst()
ResultSetCommon::isIgnoreAssocCase()
ResultSetCommon::last()
ResultSetCommon::previous()
ResultSetCommon::relative()
ResultSetCommon::setFetchmode()
ResultSetCommon::__destruct()
Destructor

Class Details

[line 46]
ODBC implementation of a cached ResultSet.

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 record count retrieval (odbc_num_rows()), 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.

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




Tags:

version:  $Revision: 1.1 $
author:  Dave Lawson <dlawson@masterytech.com>


[ Top ]


Class Variables

$cacheLobs =  false

[line 62]

True if blobs/clobs should also be cached.



Tags:

access:  protected

Type:   mixed


[ Top ]

$lastPos =  -1

[line 57]

Tracks the last cursor position of the recordset.



Tags:

access:  protected

Type:   mixed


[ Top ]

$recs = array()

[line 52]

Record cache



Tags:

access:  protected

Type:   array


[ Top ]



Class Methods


constructor __construct [line 67]

ODBCCachedResultSet __construct( Connection $conn, mixed $result, [mixed $fetchmode = null], [mixed $cacheLobs = false])



Tags:

access:  public
see:  ResultSet::__construct()


Overrides ODBCResultSetCommon::__construct() (parent method not documented)

[ Top ]

method close [line 77]

void close( )



Tags:



Overrides ODBCResultSetCommon::close() (parent method not documented)

[ Top ]

method getRecordCount [line 199]

void getRecordCount( )



Tags:



[ Top ]

method isAfterLast [line 210]

void isAfterLast( )



Tags:

access:  public
see:  ResultSet::isAfterLast()


Overrides ResultSetCommon::isAfterLast() (parent method not documented)

[ Top ]

method loadCache [line 90]

void loadCache( [mixed $recPos = -1])

Caches specified records up to and including the specified 1-based record position. If -1 is specified, all records will be cached.



Tags:

access:  public
throws:  SQLException


[ Top ]

method next [line 167]

void next( )



Tags:



[ Top ]

method seek [line 152]

void seek( mixed $rownum)



Tags:

access:  public
see:  ResultSet::seek()


[ Top ]


Documentation generated on Mon, 23 Aug 2004 21:52:16 -0400 by phpDocumentor 1.3.0RC3