com.caucho.quercus.lib.db
Class JdbcPreparedStatementResource

java.lang.Object
  extended by com.caucho.quercus.lib.db.JdbcStatementResource
      extended by com.caucho.quercus.lib.db.JdbcPreparedStatementResource
Direct Known Subclasses:
MysqliStatement, OracleStatement, PDOStatement, PostgresStatement

public class JdbcPreparedStatementResource
extends JdbcStatementResource

Represents a JDBC Statement value.


Constructor Summary
JdbcPreparedStatementResource(JdbcConnectionResource conn)
          Constructor for JdbcStatementResource
 
Method Summary
protected  boolean bindParams(Env env, ColumnType[] types, Value[] params)
          Creates _types and _params array for this prepared statement.
protected  boolean executeImpl(Env env)
           
protected  Value getParam(int i)
          Returns a parameter value Known subclasses: see PostgresStatement.execute
protected  int getParamLength()
          Returns the number of parameters available to binding Known subclasses: see PostgresStatement.execute
protected  java.sql.PreparedStatement getPreparedStatement()
          Returns the internal prepared statement.
protected  boolean isPreparable(java.lang.String query)
           
 int paramCount()
          Counts the number of parameter markers in the query string.
 boolean prepare(Env env, java.lang.String query)
          Prepares this statement with the given query.
protected  boolean prepareForExecute(Env env)
           
protected  void setObject(int i, java.lang.Object param)
          Sets the given parameter Known subclasses: see PostgresStatement.execute
protected  void setPreparedStatement(java.sql.PreparedStatement stmt)
          Changes the internal statement.
 
Methods inherited from class com.caucho.quercus.lib.db.JdbcStatementResource
bindResults, close, createResultSet, dataSeek, execute, execute, fetch, freeResult, getColumnCount, getConnection, getErrorCode, getErrorMessage, getFieldCount, getJavaConnection, getMetaData, getNumRows, getQuery, getResultSet, getStatementType, isFetchFieldIndexBeforeFieldName, lastInsertId, setError, setErrorCode, setErrorMessage, setQuery, setResultSet, setStatement, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JdbcPreparedStatementResource

public JdbcPreparedStatementResource(JdbcConnectionResource conn)
Constructor for JdbcStatementResource

Parameters:
connV - a JdbcConnectionResource connection
Method Detail

bindParams

protected boolean bindParams(Env env,
                             ColumnType[] types,
                             Value[] params)
Creates _types and _params array for this prepared statement.

Parameters:
types - = string of i,d,s,b (ie: "idds")
params - = array of values (probably Vars)
Returns:
true on success ir false on failure

prepareForExecute

protected boolean prepareForExecute(Env env)
                             throws java.sql.SQLException
Overrides:
prepareForExecute in class JdbcStatementResource
Throws:
java.sql.SQLException

executeImpl

protected boolean executeImpl(Env env)
                       throws java.sql.SQLException
Overrides:
executeImpl in class JdbcStatementResource
Throws:
java.sql.SQLException

getPreparedStatement

protected java.sql.PreparedStatement getPreparedStatement()
Returns the internal prepared statement.

Returns:
the internal prepared statement

paramCount

public int paramCount()
Counts the number of parameter markers in the query string.

Returns:
the number of parameter markers in the query string

prepare

public boolean prepare(Env env,
                       java.lang.String query)
Prepares this statement with the given query.

Parameters:
query - SQL query
Returns:
true on success or false on failure

isPreparable

protected boolean isPreparable(java.lang.String query)

getParam

protected Value getParam(int i)
Returns a parameter value Known subclasses: see PostgresStatement.execute


getParamLength

protected int getParamLength()
Returns the number of parameters available to binding Known subclasses: see PostgresStatement.execute


setPreparedStatement

protected void setPreparedStatement(java.sql.PreparedStatement stmt)
Changes the internal statement.


setObject

protected void setObject(int i,
                         java.lang.Object param)
                  throws java.sql.SQLException
Sets the given parameter Known subclasses: see PostgresStatement.execute

Throws:
java.sql.SQLException