com.caucho.quercus.lib.db
Class PDO

java.lang.Object
  extended by com.caucho.quercus.lib.db.PDO
All Implemented Interfaces:
EnvCleanup

public class PDO
extends java.lang.Object
implements EnvCleanup

PDO object oriented API facade.


Field Summary
static int ATTR_AUTOCOMMIT
           
static int ATTR_CASE
           
static int ATTR_CLIENT_VERSION
           
static int ATTR_CONNECTION_STATUS
           
static int ATTR_CURSOR
           
static int ATTR_CURSOR_NAME
           
static int ATTR_DEFAULT_FETCH_MODE
           
static int ATTR_DRIVER_NAME
           
static int ATTR_EMULATE_PREPARES
           
static int ATTR_ERRMODE
           
static int ATTR_FETCH_CATALOG_NAMES
           
static int ATTR_FETCH_TABLE_NAMES
           
static int ATTR_MAX_COLUMN_LEN
           
static int ATTR_ORACLE_NULLS
           
static int ATTR_PERSISTENT
           
static int ATTR_PREFETCH
           
static int ATTR_SERVER_INFO
           
static int ATTR_SERVER_VERSION
           
static int ATTR_STATEMENT_CLASS
           
static int ATTR_STRINGIFY_FETCHES
           
static int ATTR_TIMEOUT
           
static int CASE_LOWER
           
static int CASE_NATURAL
           
static int CASE_UPPER
           
static int CURSOR_FWDONLY
           
static int CURSOR_SCROLL
           
static java.lang.String ERR_NONE
           
static int ERRMODE_EXCEPTION
           
static int ERRMODE_SILENT
           
static int ERRMODE_WARNING
           
static int FETCH_ASSOC
           
static int FETCH_BOTH
           
static int FETCH_BOUND
           
static int FETCH_CLASS
           
static int FETCH_CLASSTYPE
           
static int FETCH_COLUMN
           
static int FETCH_FUNC
           
static int FETCH_GROUP
           
static int FETCH_INTO
           
static int FETCH_KEY_PAIR
           
static int FETCH_LAZY
           
static int FETCH_NAMED
           
static int FETCH_NUM
           
static int FETCH_OBJ
           
static int FETCH_ORI_ABS
           
static int FETCH_ORI_FIRST
           
static int FETCH_ORI_LAST
           
static int FETCH_ORI_NEXT
           
static int FETCH_ORI_PRIOR
           
static int FETCH_ORI_REL
           
static int FETCH_PROPS_LATE
           
static int FETCH_SERIALIZE
           
static int FETCH_UNIQUE
           
static int NULL_EMPTY_STRING
           
static int NULL_NATURAL
           
static int NULL_TO_STRING
           
static int PARAM_BOOL
           
static int PARAM_EVT_ALLOC
           
static int PARAM_EVT_EXEC_POST
           
static int PARAM_EVT_EXEC_PRE
           
static int PARAM_EVT_FETCH_POST
           
static int PARAM_EVT_FETCH_PRE
           
static int PARAM_EVT_FREE
           
static int PARAM_EVT_NORMALIZE
           
static int PARAM_INPUT_OUTPUT
           
static int PARAM_INT
           
static int PARAM_LOB
           
static int PARAM_NULL
           
static int PARAM_STMT
           
static int PARAM_STR
           
 
Constructor Summary
PDO(Env env, java.lang.String dsn, java.lang.String user, java.lang.String password, ArrayValue options)
           
 
Method Summary
 boolean beginTransaction()
          Starts a transaction.
 void cleanup()
          Implements the EnvCleanup interface.
 void close()
           
 boolean commit()
          Commits a transaction.
 java.lang.String errorCode()
           
 ArrayValue errorInfo()
           
 int exec(java.lang.String query)
          Executes a statement, returning the number of rows.
 Value getAttribute(int attribute)
           
static ArrayValue getAvailableDrivers()
           
 int getCase()
           
 int getOracleNulls()
           
 java.lang.String lastInsertId(java.lang.String name)
           
 PDOStatement prepare(java.lang.String statement, ArrayValue driverOptions)
          Prepares a statement for execution.
 Value query(java.lang.String query)
          Queries the database
 java.lang.String quote(java.lang.String query, int parameterType)
          Quotes the string
 java.lang.String real_escape_string(java.lang.String str)
          Escapes the string.
 boolean rollBack()
          Rolls a transaction back.
 boolean setAttribute(int attribute, Value value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_AUTOCOMMIT

public static final int ATTR_AUTOCOMMIT
See Also:
Constant Field Values

ATTR_PREFETCH

public static final int ATTR_PREFETCH
See Also:
Constant Field Values

ATTR_TIMEOUT

public static final int ATTR_TIMEOUT
See Also:
Constant Field Values

ATTR_ERRMODE

public static final int ATTR_ERRMODE
See Also:
Constant Field Values

ATTR_SERVER_VERSION

public static final int ATTR_SERVER_VERSION
See Also:
Constant Field Values

ATTR_CLIENT_VERSION

public static final int ATTR_CLIENT_VERSION
See Also:
Constant Field Values

ATTR_SERVER_INFO

public static final int ATTR_SERVER_INFO
See Also:
Constant Field Values

ATTR_CONNECTION_STATUS

public static final int ATTR_CONNECTION_STATUS
See Also:
Constant Field Values

ATTR_CASE

public static final int ATTR_CASE
See Also:
Constant Field Values

ATTR_CURSOR_NAME

public static final int ATTR_CURSOR_NAME
See Also:
Constant Field Values

ATTR_CURSOR

public static final int ATTR_CURSOR
See Also:
Constant Field Values

ATTR_ORACLE_NULLS

public static final int ATTR_ORACLE_NULLS
See Also:
Constant Field Values

ATTR_PERSISTENT

public static final int ATTR_PERSISTENT
See Also:
Constant Field Values

ATTR_STATEMENT_CLASS

public static final int ATTR_STATEMENT_CLASS
See Also:
Constant Field Values

ATTR_FETCH_TABLE_NAMES

public static final int ATTR_FETCH_TABLE_NAMES
See Also:
Constant Field Values

ATTR_FETCH_CATALOG_NAMES

public static final int ATTR_FETCH_CATALOG_NAMES
See Also:
Constant Field Values

ATTR_DRIVER_NAME

public static final int ATTR_DRIVER_NAME
See Also:
Constant Field Values

ATTR_STRINGIFY_FETCHES

public static final int ATTR_STRINGIFY_FETCHES
See Also:
Constant Field Values

ATTR_MAX_COLUMN_LEN

public static final int ATTR_MAX_COLUMN_LEN
See Also:
Constant Field Values

ATTR_DEFAULT_FETCH_MODE

public static final int ATTR_DEFAULT_FETCH_MODE
See Also:
Constant Field Values

ATTR_EMULATE_PREPARES

public static final int ATTR_EMULATE_PREPARES
See Also:
Constant Field Values

CASE_NATURAL

public static final int CASE_NATURAL
See Also:
Constant Field Values

CASE_UPPER

public static final int CASE_UPPER
See Also:
Constant Field Values

CASE_LOWER

public static final int CASE_LOWER
See Also:
Constant Field Values

CURSOR_FWDONLY

public static final int CURSOR_FWDONLY
See Also:
Constant Field Values

CURSOR_SCROLL

public static final int CURSOR_SCROLL
See Also:
Constant Field Values

ERR_NONE

public static final java.lang.String ERR_NONE
See Also:
Constant Field Values

ERRMODE_SILENT

public static final int ERRMODE_SILENT
See Also:
Constant Field Values

ERRMODE_WARNING

public static final int ERRMODE_WARNING
See Also:
Constant Field Values

ERRMODE_EXCEPTION

public static final int ERRMODE_EXCEPTION
See Also:
Constant Field Values

FETCH_LAZY

public static final int FETCH_LAZY
See Also:
Constant Field Values

FETCH_ASSOC

public static final int FETCH_ASSOC
See Also:
Constant Field Values

FETCH_NUM

public static final int FETCH_NUM
See Also:
Constant Field Values

FETCH_BOTH

public static final int FETCH_BOTH
See Also:
Constant Field Values

FETCH_OBJ

public static final int FETCH_OBJ
See Also:
Constant Field Values

FETCH_BOUND

public static final int FETCH_BOUND
See Also:
Constant Field Values

FETCH_COLUMN

public static final int FETCH_COLUMN
See Also:
Constant Field Values

FETCH_CLASS

public static final int FETCH_CLASS
See Also:
Constant Field Values

FETCH_INTO

public static final int FETCH_INTO
See Also:
Constant Field Values

FETCH_FUNC

public static final int FETCH_FUNC
See Also:
Constant Field Values

FETCH_NAMED

public static final int FETCH_NAMED
See Also:
Constant Field Values

FETCH_KEY_PAIR

public static final int FETCH_KEY_PAIR
See Also:
Constant Field Values

FETCH_GROUP

public static final int FETCH_GROUP
See Also:
Constant Field Values

FETCH_UNIQUE

public static final int FETCH_UNIQUE
See Also:
Constant Field Values

FETCH_CLASSTYPE

public static final int FETCH_CLASSTYPE
See Also:
Constant Field Values

FETCH_SERIALIZE

public static final int FETCH_SERIALIZE
See Also:
Constant Field Values

FETCH_ORI_NEXT

public static final int FETCH_ORI_NEXT
See Also:
Constant Field Values

FETCH_ORI_PRIOR

public static final int FETCH_ORI_PRIOR
See Also:
Constant Field Values

FETCH_ORI_FIRST

public static final int FETCH_ORI_FIRST
See Also:
Constant Field Values

FETCH_ORI_LAST

public static final int FETCH_ORI_LAST
See Also:
Constant Field Values

FETCH_ORI_ABS

public static final int FETCH_ORI_ABS
See Also:
Constant Field Values

FETCH_ORI_REL

public static final int FETCH_ORI_REL
See Also:
Constant Field Values

FETCH_PROPS_LATE

public static final int FETCH_PROPS_LATE
See Also:
Constant Field Values

NULL_NATURAL

public static final int NULL_NATURAL
See Also:
Constant Field Values

NULL_EMPTY_STRING

public static final int NULL_EMPTY_STRING
See Also:
Constant Field Values

NULL_TO_STRING

public static final int NULL_TO_STRING
See Also:
Constant Field Values

PARAM_NULL

public static final int PARAM_NULL
See Also:
Constant Field Values

PARAM_INT

public static final int PARAM_INT
See Also:
Constant Field Values

PARAM_STR

public static final int PARAM_STR
See Also:
Constant Field Values

PARAM_LOB

public static final int PARAM_LOB
See Also:
Constant Field Values

PARAM_STMT

public static final int PARAM_STMT
See Also:
Constant Field Values

PARAM_BOOL

public static final int PARAM_BOOL
See Also:
Constant Field Values

PARAM_EVT_ALLOC

public static final int PARAM_EVT_ALLOC
See Also:
Constant Field Values

PARAM_EVT_EXEC_POST

public static final int PARAM_EVT_EXEC_POST
See Also:
Constant Field Values

PARAM_EVT_EXEC_PRE

public static final int PARAM_EVT_EXEC_PRE
See Also:
Constant Field Values

PARAM_EVT_FETCH_POST

public static final int PARAM_EVT_FETCH_POST
See Also:
Constant Field Values

PARAM_EVT_FETCH_PRE

public static final int PARAM_EVT_FETCH_PRE
See Also:
Constant Field Values

PARAM_EVT_FREE

public static final int PARAM_EVT_FREE
See Also:
Constant Field Values

PARAM_EVT_NORMALIZE

public static final int PARAM_EVT_NORMALIZE
See Also:
Constant Field Values

PARAM_INPUT_OUTPUT

public static final int PARAM_INPUT_OUTPUT
See Also:
Constant Field Values
Constructor Detail

PDO

public PDO(Env env,
           java.lang.String dsn,
           java.lang.String user,
           java.lang.String password,
           ArrayValue options)
Method Detail

beginTransaction

public boolean beginTransaction()
Starts a transaction.


commit

public boolean commit()
Commits a transaction.


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()

exec

public int exec(java.lang.String query)
         throws java.sql.SQLException
Executes a statement, returning the number of rows.

Throws:
java.sql.SQLException

getAttribute

public Value getAttribute(int attribute)

getAvailableDrivers

public static ArrayValue getAvailableDrivers()

getCase

public int getCase()

getOracleNulls

public int getOracleNulls()

lastInsertId

public java.lang.String lastInsertId(java.lang.String name)

prepare

public PDOStatement prepare(java.lang.String statement,
                            ArrayValue driverOptions)
Prepares a statement for execution.


query

public Value query(java.lang.String query)
Queries the database


quote

public java.lang.String quote(java.lang.String query,
                              int parameterType)
Quotes the string


real_escape_string

public java.lang.String real_escape_string(java.lang.String str)
Escapes the string.


rollBack

public boolean rollBack()
Rolls a transaction back.


setAttribute

public boolean setAttribute(int attribute,
                            Value value)

toString

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