com.caucho.quercus.lib.db
Class PDOStatement

java.lang.Object
  extended by com.caucho.quercus.lib.db.PDOStatement
All Implemented Interfaces:
EnvCleanup, java.lang.Iterable<Value>

public class PDOStatement
extends java.lang.Object
implements java.lang.Iterable<Value>, EnvCleanup

PDO object oriented API facade.


Method Summary
 boolean bindColumn(Value column, Value var, int type)
           
 boolean bindParam(Value parameter, Value variable, int dataType, int length, Value driverOptions)
           
 boolean bindValue(Value parameter, Value value, int dataType)
           
 void cleanup()
          Implements the EnvCleanup interface.
 void close()
           
 boolean closeCursor()
          Closes the current cursor.
 int columnCount()
          Returns the number of columns.
 com.caucho.quercus.lib.db.PDOStatement.BindParam createBindParam(Value parameter, Value value, int dataType, int length, Value driverOptions)
           
 java.lang.String errorCode()
           
 ArrayValue errorInfo()
           
 boolean execute(Value inputParameters)
          Execute the statement.
 Value fetch(int fetchMode, int cursorOrientation, int cursorOffset)
          Fetch the next row.
 Value fetchAll(int fetchMode, int columnIndex)
           
 Value fetchColumn(int column)
           
 Value fetchObject(java.lang.String className, Value[] args)
           
 Value getAttribute(int attribute)
           
 Value getColumnMeta(int column)
           
 java.util.Iterator<Value> iterator()
          Returns an iterator of the values.
 boolean nextRowset()
           
 int rowCount()
           
 boolean setAttribute(int attribute, Value value)
           
 boolean setAttribute(int attribute, Value value, boolean isFromConstructor)
           
 boolean setFetchMode(int fetchMode, Value[] args)
          Sets the fetch mode, the default is PDO.FETCH_BOTH.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

bindColumn

public boolean bindColumn(Value column,
                          Value var,
                          int type)

bindParam

public boolean bindParam(Value parameter,
                         Value variable,
                         int dataType,
                         int length,
                         Value driverOptions)

bindValue

public boolean bindValue(Value parameter,
                         Value value,
                         int dataType)

closeCursor

public boolean closeCursor()
Closes the current cursor.


columnCount

public int columnCount()
Returns the number of columns.


createBindParam

public com.caucho.quercus.lib.db.PDOStatement.BindParam createBindParam(Value parameter,
                                                                        Value value,
                                                                        int dataType,
                                                                        int length,
                                                                        Value driverOptions)

close

public void close()

cleanup

public void cleanup()
Implements the EnvCleanup interface.

Specified by:
cleanup in interface EnvCleanup

errorCode

public java.lang.String errorCode()

errorInfo

public ArrayValue errorInfo()

execute

public boolean execute(Value inputParameters)
Execute the statement.

Parameters:
inputParameters - an array containing input values to correspond to the bound parameters for the statement.
Returns:
true for success, false for failure

fetch

public Value fetch(int fetchMode,
                   int cursorOrientation,
                   int cursorOffset)
Fetch the next row.

Parameters:
fetchMode - the mode, 0 to use the value set by setFetchMode(int, com.caucho.quercus.env.Value[]).
Returns:
a value, BooleanValue.FALSE if there are no more rows or an error occurs.

fetchAll

public Value fetchAll(int fetchMode,
                      int columnIndex)
Parameters:
fetchMode -
columnIndex - 0-based column index when fetchMode is FETCH_BOTH

fetchColumn

public Value fetchColumn(int column)
Parameters:
column - 0-based column number

fetchObject

public Value fetchObject(java.lang.String className,
                         Value[] args)

getAttribute

public Value getAttribute(int attribute)

getColumnMeta

public Value getColumnMeta(int column)
Parameters:
column - 0-based column index

iterator

public java.util.Iterator<Value> iterator()
Returns an iterator of the values.

Specified by:
iterator in interface java.lang.Iterable<Value>

nextRowset

public boolean nextRowset()

rowCount

public int rowCount()

setAttribute

public boolean setAttribute(int attribute,
                            Value value)

setAttribute

public boolean setAttribute(int attribute,
                            Value value,
                            boolean isFromConstructor)

setFetchMode

public boolean setFetchMode(int fetchMode,
                            Value[] args)
Sets the fetch mode, the default is PDO.FETCH_BOTH.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object