Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mockobjects.eziba.sql
Class PreparedStatement  view PreparedStatement download PreparedStatement.java

java.lang.Object
  extended bycom.mockobjects.eziba.sql.Statement
      extended bycom.mockobjects.eziba.sql.PreparedStatement
All Implemented Interfaces:
java.sql.PreparedStatement, java.sql.Statement
Direct Known Subclasses:
CallableStatement

public class PreparedStatement
extends Statement
implements java.sql.PreparedStatement


Field Summary
protected  java.util.Vector m_args
           
private  java.sql.ResultSet m_resultSet
           
private  int m_returnValue
           
 
Fields inherited from class com.mockobjects.eziba.sql.Statement
connection, sql
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Constructor Summary
(package private) PreparedStatement(Connection p_connection, java.lang.String p_sql)
           
 
Method Summary
 void addBatch()
          This method adds a set of parameters to the batch for JDBC 2.0.
 void clearParameters()
          This method clears all of the input parameter that have been set on this statement.
 boolean execute()
          This method executes a prepared SQL query.
 java.sql.ResultSet executeQuery()
          This method executes a prepared SQL query and returns its ResultSet.
 int executeUpdate()
          This method executes an SQL INSERT, UPDATE or DELETE statement.
protected  java.lang.Object[] getArguments()
           
 java.sql.ResultSetMetaData getMetaData()
          This method returns meta data for the result set from this statement.
 java.sql.ResultSet getResultSet()
          This method returns the result set of the SQL statement that was executed.
 int getUpdateCount()
          This method returns the update count of the SQL statement that was executed.
protected  void setArg(int p_pos, java.lang.Object p_arg)
           
 void setArray(int i, java.sql.Array x)
          This method sets the specified parameter from the given Java Array value.
 void setAsciiStream(int parameterIndex, java.io.InputStream x, int length)
          This method sets the specified parameter from the given Java ASCII InputStream value.
 void setBigDecimal(int parameterIndex, java.math.BigDecimal x)
          This method sets the specified parameter from the given Java java.math.BigDecimal value.
 void setBinaryStream(int parameterIndex, java.io.InputStream x, int length)
          This method sets the specified parameter from the given Java binary InputStream value.
 void setBlob(int i, java.sql.Blob x)
          This method sets the specified parameter from the given Java Blob value.
 void setBoolean(int parameterIndex, boolean x)
          This method sets the specified parameter from the given Java boolean value.
 void setByte(int parameterIndex, byte x)
          This method sets the specified parameter from the given Java byte value.
 void setBytes(int parameterIndex, byte[] x)
          This method sets the specified parameter from the given Java byte array value.
 void setCharacterStream(int parameterIndex, java.io.Reader reader, int length)
          This method sets the specified parameter from the given Java character Reader value.
 void setClob(int i, java.sql.Clob x)
          This method sets the specified parameter from the given Java Clob value.
 void setDate(int parameterIndex, java.sql.Date x)
          This method sets the specified parameter from the given Java java.sql.Date value.
 void setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal)
          This method sets the specified parameter from the given Java java.sql.Date value.
 void setDouble(int parameterIndex, double x)
          This method sets the specified parameter from the given Java double value.
 void setFloat(int parameterIndex, float x)
          This method sets the specified parameter from the given Java float value.
 void setInt(int parameterIndex, int x)
          This method sets the specified parameter from the given Java int value.
 void setLong(int parameterIndex, long x)
          This method sets the specified parameter from the given Java long value.
 void setNull(int parameterIndex, int sqlType)
          This method populates the specified parameter with a SQL NULL value for the specified type.
 void setNull(int paramIndex, int sqlType, java.lang.String typeName)
          This method populates the specified parameter with a SQL NULL value for the specified type.
 void setObject(int parameterIndex, java.lang.Object x)
          This method sets the specified parameter from the given Java Object value.
 void setObject(int parameterIndex, java.lang.Object x, int targetSqlType)
          This method sets the specified parameter from the given Java Object value.
 void setObject(int parameterIndex, java.lang.Object x, int targetSqlType, int scale)
          This method sets the specified parameter from the given Java Object value.
 void setRef(int i, java.sql.Ref x)
          This method sets the specified parameter from the given Java Ref value.
 void setShort(int parameterIndex, short x)
          This method sets the specified parameter from the given Java short value.
 void setString(int parameterIndex, java.lang.String x)
          This method sets the specified parameter from the given Java String value.
 void setTime(int parameterIndex, java.sql.Time x)
          This method sets the specified parameter from the given Java java.sql.Time value.
 void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal)
          This method sets the specified parameter from the given Java java.sql.Time value.
 void setTimestamp(int parameterIndex, java.sql.Timestamp x)
          This method sets the specified parameter from the given Java java.sql.Timestamp value.
 void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal)
          This method sets the specified parameter from the given Java java.sql.Timestamp value.
 void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length)
          This method sets the specified parameter from the given Java Unicode UTF-8 InputStream value.
 
Methods inherited from class com.mockobjects.eziba.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, executeBatch, executeQuery, executeUpdate, getConnection, getFetchDirection, getFetchSize, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetType, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.PreparedStatement
getParameterMetaData, setURL
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Field Detail

m_args

protected final java.util.Vector m_args

m_returnValue

private int m_returnValue

m_resultSet

private java.sql.ResultSet m_resultSet
Constructor Detail

PreparedStatement

PreparedStatement(Connection p_connection,
                  java.lang.String p_sql)
Method Detail

setArg

protected void setArg(int p_pos,
                      java.lang.Object p_arg)

getArguments

protected final java.lang.Object[] getArguments()

addBatch

public void addBatch()
Description copied from interface: java.sql.PreparedStatement
This method adds a set of parameters to the batch for JDBC 2.0.

Specified by:
addBatch in interface java.sql.PreparedStatement

clearParameters

public void clearParameters()
Description copied from interface: java.sql.PreparedStatement
This method clears all of the input parameter that have been set on this statement.

Specified by:
clearParameters in interface java.sql.PreparedStatement

execute

public boolean execute()
                throws java.sql.SQLException
Description copied from interface: java.sql.PreparedStatement
This method executes a prepared SQL query. Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate.

Specified by:
execute in interface java.sql.PreparedStatement

getResultSet

public java.sql.ResultSet getResultSet()
Description copied from interface: java.sql.Statement
This method returns the result set of the SQL statement that was executed. This should be called only once per result set returned.

Specified by:
getResultSet in interface java.sql.Statement
Overrides:
getResultSet in class Statement

getUpdateCount

public int getUpdateCount()
Description copied from interface: java.sql.Statement
This method returns the update count of the SQL statement that was executed. This should be called only once per executed SQL statement.

Specified by:
getUpdateCount in interface java.sql.Statement
Overrides:
getUpdateCount in class Statement

executeQuery

public java.sql.ResultSet executeQuery()
                                throws java.sql.SQLException
Description copied from interface: java.sql.PreparedStatement
This method executes a prepared SQL query and returns its ResultSet.

Specified by:
executeQuery in interface java.sql.PreparedStatement

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException
Description copied from interface: java.sql.PreparedStatement
This method executes an SQL INSERT, UPDATE or DELETE statement. SQL statements that return nothing such as SQL DDL statements can be executed.

Specified by:
executeUpdate in interface java.sql.PreparedStatement

setInt

public void setInt(int parameterIndex,
                   int x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java int value.

Specified by:
setInt in interface java.sql.PreparedStatement

setString

public void setString(int parameterIndex,
                      java.lang.String x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java String value.

Specified by:
setString in interface java.sql.PreparedStatement

setBigDecimal

public void setBigDecimal(int parameterIndex,
                          java.math.BigDecimal x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java java.math.BigDecimal value.

Specified by:
setBigDecimal in interface java.sql.PreparedStatement

setBinaryStream

public void setBinaryStream(int parameterIndex,
                            java.io.InputStream x,
                            int length)
                     throws java.sql.SQLException
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java binary InputStream value.

Specified by:
setBinaryStream in interface java.sql.PreparedStatement

setNull

public void setNull(int parameterIndex,
                    int sqlType)
Description copied from interface: java.sql.PreparedStatement
This method populates the specified parameter with a SQL NULL value for the specified type.

Specified by:
setNull in interface java.sql.PreparedStatement

getMetaData

public java.sql.ResultSetMetaData getMetaData()
Description copied from interface: java.sql.PreparedStatement
This method returns meta data for the result set from this statement.

Specified by:
getMetaData in interface java.sql.PreparedStatement

setArray

public void setArray(int i,
                     java.sql.Array x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java Array value. The default object type to SQL type mapping will be used.

Specified by:
setArray in interface java.sql.PreparedStatement

setAsciiStream

public void setAsciiStream(int parameterIndex,
                           java.io.InputStream x,
                           int length)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java ASCII InputStream value.

Specified by:
setAsciiStream in interface java.sql.PreparedStatement

setBlob

public void setBlob(int i,
                    java.sql.Blob x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java Blob value. The default object type to SQL type mapping will be used.

Specified by:
setBlob in interface java.sql.PreparedStatement

setBoolean

public void setBoolean(int parameterIndex,
                       boolean x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java boolean value.

Specified by:
setBoolean in interface java.sql.PreparedStatement

setByte

public void setByte(int parameterIndex,
                    byte x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java byte value.

Specified by:
setByte in interface java.sql.PreparedStatement

setBytes

public void setBytes(int parameterIndex,
                     byte[] x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java byte array value.

Specified by:
setBytes in interface java.sql.PreparedStatement

setCharacterStream

public void setCharacterStream(int parameterIndex,
                               java.io.Reader reader,
                               int length)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java character Reader value.

Specified by:
setCharacterStream in interface java.sql.PreparedStatement

setClob

public void setClob(int i,
                    java.sql.Clob x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java Clob value. The default object type to SQL type mapping will be used.

Specified by:
setClob in interface java.sql.PreparedStatement

setDate

public void setDate(int parameterIndex,
                    java.sql.Date x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java java.sql.Date value.

Specified by:
setDate in interface java.sql.PreparedStatement

setDate

public void setDate(int parameterIndex,
                    java.sql.Date x,
                    java.util.Calendar cal)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java java.sql.Date value.

Specified by:
setDate in interface java.sql.PreparedStatement

setDouble

public void setDouble(int parameterIndex,
                      double x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java double value.

Specified by:
setDouble in interface java.sql.PreparedStatement

setFloat

public void setFloat(int parameterIndex,
                     float x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java float value.

Specified by:
setFloat in interface java.sql.PreparedStatement

setLong

public void setLong(int parameterIndex,
                    long x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java long value.

Specified by:
setLong in interface java.sql.PreparedStatement

setNull

public void setNull(int paramIndex,
                    int sqlType,
                    java.lang.String typeName)
Description copied from interface: java.sql.PreparedStatement
This method populates the specified parameter with a SQL NULL value for the specified type.

Specified by:
setNull in interface java.sql.PreparedStatement

setObject

public void setObject(int parameterIndex,
                      java.lang.Object x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java Object value. The default object type to SQL type mapping will be used.

Specified by:
setObject in interface java.sql.PreparedStatement

setObject

public void setObject(int parameterIndex,
                      java.lang.Object x,
                      int targetSqlType)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java Object value. The specified SQL object type will be used.

Specified by:
setObject in interface java.sql.PreparedStatement

setObject

public void setObject(int parameterIndex,
                      java.lang.Object x,
                      int targetSqlType,
                      int scale)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java Object value. The specified SQL object type will be used.

Specified by:
setObject in interface java.sql.PreparedStatement

setRef

public void setRef(int i,
                   java.sql.Ref x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java Ref value. The default object type to SQL type mapping will be used.

Specified by:
setRef in interface java.sql.PreparedStatement

setShort

public void setShort(int parameterIndex,
                     short x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java short value.

Specified by:
setShort in interface java.sql.PreparedStatement

setTime

public void setTime(int parameterIndex,
                    java.sql.Time x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java java.sql.Time value.

Specified by:
setTime in interface java.sql.PreparedStatement

setTime

public void setTime(int parameterIndex,
                    java.sql.Time x,
                    java.util.Calendar cal)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java java.sql.Time value.

Specified by:
setTime in interface java.sql.PreparedStatement

setTimestamp

public void setTimestamp(int parameterIndex,
                         java.sql.Timestamp x)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java java.sql.Timestamp value.

Specified by:
setTimestamp in interface java.sql.PreparedStatement

setTimestamp

public void setTimestamp(int parameterIndex,
                         java.sql.Timestamp x,
                         java.util.Calendar cal)
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java java.sql.Timestamp value.

Specified by:
setTimestamp in interface java.sql.PreparedStatement

setUnicodeStream

public void setUnicodeStream(int parameterIndex,
                             java.io.InputStream x,
                             int length)
Deprecated.  

Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java Unicode UTF-8 InputStream value.

Specified by:
setUnicodeStream in interface java.sql.PreparedStatement