com.sas.rio
Class MVAPreparedStatement

java.lang.Object
  |
  +--com.sas.rio.MVAStatement
        |
        +--com.sas.rio.MVAPreparedStatement
All Implemented Interfaces:
RIOStatementInterface,
Direct Known Subclasses:
MVACallableStatement

public class MVAPreparedStatement
extends MVAStatement
implements java.sql.PreparedStatement


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
 
Method Summary
 void addBatch()
          JDBC 2.0 Adds a set of parameters to the batch.
 void clearParameters()
          Clears all the parameters.
 boolean execute()
          Executes a query.
 ResultSet executeQuery()
          Executes a prepared SQL query and returns the ResultSet.
 int executeUpdate()
          Executes an SQL INSERT, UPDATE or DELETE statement.
 ResultSetMetaData getMetaData()
          JDBC 2.0 Gets the number, types and properties of a ResultSet's columns as a ResultSetMetaData object.
 ParameterMetaData getParameterMetaData()
          Retrieves the number, types and properties of this PreparedStatement object's parameters.
 void registerOutParameter(int parameterIndex, int sqlType, String x)
          JDBC 2.0 This method is not yet supported.
 void setArray(int parameterIndex, Array x)
          JDBC 2.0 Sets a parameter to an Array object.
 void setAsciiStream(int parameterIndex, InputStream x, int length)
          Sets a parameter to a Java java.io.InputStream.
 void setBigDecimal(int parameterIndex, BigDecimal x)
          Sets a parameter to a Java BigDecimal value.
 void setBinaryStream(int parameterIndex, InputStream x, int length)
          Sets a parameter to a Java java.io.InputStream.
 void setBlob(int parameterIndex, Blob x)
          JDBC 2.0 Sets a parameter to a BLOB object.
 void setBoolean(int parameterIndex, boolean x)
          Sets a parameter to a Java Boolean value.
 void setByte(int parameterIndex, byte x)
          Sets a parameter to a Java byte value.
 void setBytes(int parameterIndex, byte[] x)
          Sets a parameter to a Java byte array value.
 void setCharacterStream(int parameterIndex, Reader reader, int length)
          JDBC 2.0 Sets a parameter to java.io.Reader object.
 void setClob(int parameterIndex, Clob x)
          JDBC 2.0 Sets a parameter to a CLOB object.
 void setDate(int parameterIndex, Date x)
          Sets a parameter to a Java java.sql.Date value.
 void setDate(int parameterIndex, Date x, Calendar cal)
          JDBC 2.0 Sets a parameter to a java.sql.Date value.
 void setDouble(int parameterIndex, double x)
          Sets a parameter to a Java double value.
 void setFloat(int parameterIndex, float x)
          Sets a parameter to a Java float value.
 void setInt(int parameterIndex, int x)
          Sets a parameter to a Java int value.
 void setLong(int parameterIndex, long x)
          Sets a parameter to a Java long value.
 void setNull(int parameterIndex, int sqlType)
          Sets a parameter to SQL NULL.
 void setNull(int parameterIndex, int sqlType, String x)
          JDBC 2.0 Sets a parameter to SQL NULL.
 void setObject(int parameterIndex, Object x)
          Sets a parameter to the default type.
 void setObject(int parameterIndex, Object x, int sqlType)
          Sets a parameter to the input type.
 void setObject(int parameterIndex, Object x, int sqlType, int scale)
          Sets a parameter to the input type.
 void setRef(int parameterIndex, Ref x)
          JDBC 2.0 Sets a parameter to a REF(<structured-type>) object.
 void setShort(int parameterIndex, short x)
          Sets a parameter to a Java short value.
 void setString(int parameterIndex, String x)
          Sets a parameter to a Java string value.
 void setTime(int parameterIndex, Time x)
          Sets a parameter to a Java java.sql.Time value.
 void setTime(int parameterIndex, Time x, Calendar cal)
          JDBC 2.0 Sets a parameter to a java.sql.Time value.
 void setTimestamp(int parameterIndex, Timestamp x)
          Sets a parameter to a Java java.sql.Timestamp value.
 void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
          JDBC 2.0 Sets a parameter to a java.sql.Timestamp value.
 void setUnicodeStream(int parameterIndex, InputStream x, int length)
          Deprecated.  
 void setURL(int parameterIndex, URL x)
          Sets the designated parameter to the given java.net.URL value.
 
Methods inherited from class com.sas.rio.MVAStatement
addBatch, cancel, clearBatch, clearWarnings, close, createTable, deleteTable, deleteTable, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getTable, getTable, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, exe cute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, < A HREF="http://java.sun.com/j2se/1.4.1/docs/api/java/sql/Statement.html#getFetchSize()">getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcu rrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Constructor Detail
Method Detail

executeQuery

public ResultSet executeQuery()
                       throws SQLException
Executes a prepared SQL query and returns the ResultSet.
Specified by:
executeQuery in interface PreparedStatement
Returns:
An MVAResultSet object that contains the data that is produced by the query.
Throws:
SQLException - This exception is thrown if an error condition is detected.

executeUpdate

public int executeUpdate()
                  throws SQLException
Executes an SQL INSERT, UPDATE or DELETE statement.
Specified by:
executeUpdate in interface PreparedStatement
Returns:
An int that contains the number of rows affected.
Throws:
SQLException - This exception is thrown if an error condition is detected.

setNull

public void setNull(int parameterIndex,
                    int sqlType)
             throws SQLException
Sets a parameter to SQL NULL.
Specified by:
setNull in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
sqlType - An SQL type code that is defined by java.sql.Types.
Throws:
SQLException - This exception is thrown if a database error is detected or if the sqlType is not FLOAT, DOUBLE, INTEGER, TIME, DATE or TIMESTAMP. If the sqlType is VARCHAR or LONGVARCHAR, an exception will not be thrown, and the value in the database will be set to a blank. SAS software does not allow other types to be NULL.

setBoolean

public void setBoolean(int parameterIndex,
                       boolean x)
                throws SQLException
Sets a parameter to a Java Boolean value. This method is not supported.
Specified by:
setBoolean in interface PreparedStatement
Throws:
SQLException - This exception is always thrown because SAS software does not support the SQL type BIT.

setByte

public void setByte(int parameterIndex,
                    byte x)
             throws SQLException
Sets a parameter to a Java byte value. This method is not supported.
Specified by:
setByte in interface PreparedStatement
Throws:
SQLException - This exception is always thrown because SAS software does not support SQL type TINYINT.

setShort

public void setShort(int parameterIndex,
                     short x)
              throws SQLException
Sets a parameter to a Java short value. This method is not supported.
Specified by:
setShort in interface PreparedStatement
Throws:
SQLException - This exception is always thrown because SAS software does not support SQL type SMALLINT.

setInt

public void setInt(int parameterIndex,
                   int x)
            throws SQLException
Sets a parameter to a Java int value.
Specified by:
setInt in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
x - An int value.
Throws:
SQLException - This exception is thrown if parameterIndex is not valid.

setLong

public void setLong(int parameterIndex,
                    long x)
             throws SQLException
Sets a parameter to a Java long value. This method is not supported.
Specified by:
setLong in interface PreparedStatement
Throws:
SQLException - This exception is always thrown because SAS software does not support SQL type BIGINT.

setFloat

public void setFloat(int parameterIndex,
                     float x)
              throws SQLException
Sets a parameter to a Java float value.
Specified by:
setFloat in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
x - float value.
Throws:
SQLException - This exception is thrown if parameter index is not valid.

setDouble

public void setDouble(int parameterIndex,
                      double x)
               throws SQLException
Sets a parameter to a Java double value.
Specified by:
setDouble in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
x - double value.
Throws:
SQLException - This exception is thrown if parameter index is not valid.

setBigDecimal

public void setBigDecimal(int parameterIndex,
                          BigDecimal x)
                   throws SQLException
Sets a parameter to a Java BigDecimal value. This method is not supported.
Specified by:
setBigDecimal in interface PreparedStatement
Throws:
SQLException - This exception is always thrown because SAS software does not support SQL type Numeric.

setString

public void setString(int parameterIndex,
                      String x)
               throws SQLException
Sets a parameter to a Java string value.
Specified by:
setString in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
x - String value.
Throws:
SQLException - This exception is thrown if parameter index is not valid.

setBytes

public void setBytes(int parameterIndex,
                     byte[] x)
              throws SQLException
Sets a parameter to a Java byte array value. This method is not supported.
Specified by:
setBytes in interface PreparedStatement
Throws:
SQLException - This exception is always thrown because SAS software does not support SQL type BINARY.

setDate

public void setDate(int parameterIndex,
                    Date x)
             throws SQLException
Sets a parameter to a Java java.sql.Date value.
Specified by:
setDate in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
x - java.sql.Date value.
Throws:
SQLException - This exception is thrown if parameter index is not valid.

setTime

public void setTime(int parameterIndex,
                    Time x)
             throws SQLException
Sets a parameter to a Java java.sql.Time value.
Specified by:
setTime in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
x - java.sql.Time value.
Throws:
SQLException - This exception is thrown if parameter index is not valid.

setTimestamp

public void setTimestamp(int parameterIndex,
                         Timestamp x)
                  throws SQLException
Sets a parameter to a Java java.sql.Timestamp value.
Specified by:
setTimestamp in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
x - java.sql.Timestamp value.
Throws:
SQLException - This exception is thrown if parameter index is not valid.

setAsciiStream

public void setAsciiStream(int parameterIndex,
                           InputStream x,
                           int length)
                    throws SQLException
Sets a parameter to a Java java.io.InputStream.
Specified by:
setAsciiStream in interface PreparedStatement
Throws:
SQLException - This exception is always thrown because SAS software does not support SQL type LONGVARCHAR.

setUnicodeStream

public void setUnicodeStream(int parameterIndex,
                             InputStream x,
                             int length)
                      throws SQLException
Deprecated.  

Sets a parameter to a Java java.io.InputStream. This method is not supported.
Specified by:
setUnicodeStream in interface PreparedStatement
Throws:
SQLException - This exception is always thrown because SAS software does not support SQL type LONGVARCHAR.

setBinaryStream

public void setBinaryStream(int parameterIndex,
                            InputStream x,
                            int length)
                     throws SQLException
Sets a parameter to a Java java.io.InputStream. This method is not supported.
Specified by:
setBinaryStream in interface PreparedStatement
Throws:
SQLException - This exception is always thrown because SAS software does not support SQL type LONGVARBINARY.

clearParameters

public void clearParameters()
                     throws SQLException
Clears all the parameters.
Specified by:
clearParameters in interface PreparedStatement
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

setObject

public void setObject(int parameterIndex,
                      Object x,
                      int sqlType,
                      int scale)
               throws SQLException
Sets a parameter to the input type.
Specified by:
setObject in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
x - An input object.
sqlType - The target SQL type for the object.
scale - This parameter is ignored. SAS software does not support Decimal or Numeric data types.
Throws:
SQLException - This exception may be thrown.

setObject

public void setObject(int parameterIndex,
                      Object x)
               throws SQLException
Sets a parameter to the default type.
Specified by:
setObject in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second parameter is 2, and so on.
x - An input object.
Throws:
SQLException - This exception may be thrown.

setObject

public void setObject(int parameterIndex,
                      Object x,
                      int sqlType)
               throws SQLException
Sets a parameter to the input type.
Specified by:
setObject in interface PreparedStatement
Parameters:
parameterIndex - The first parameter is 1, the second is 2, and so on.
x - An input object.
sqlType - The target SQL type for the object.
Throws:
SQLException - This exception may be thrown.

execute

public boolean execute()
                throws SQLException
Executes a query.
Specified by:
execute in interface PreparedStatement
Returns:
True if the result is a ResultSet; False if it is an integer.
Throws:
SQLException - This exception may be thrown.
See Also:
MVAStatement.execute(java.lang.String)

addBatch

public void addBatch()
              throws SQLException
JDBC 2.0 Adds a set of parameters to the batch. This method is not yet supported.
Specified by:
addBatch in interface PreparedStatement
Throws:
SQLException - This exception is always thrown.
See Also:
MVAStatement.addBatch(java.lang.String)

setCharacterStream

public void setCharacterStream(int parameterIndex,
                               Reader reader,
                               int length)
                        throws SQLException
JDBC 2.0 Sets a parameter to java.io.Reader object. This method is not yet supported.
Specified by:
setCharacterStream in interface PreparedStatement
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second is 2, and so on.
x - The java reader object which contains the UNICODE data.
length - The number of characters in the stream.
Throws:
SQLException - This exception is always thrown

setRef

public void setRef(int parameterIndex,
                   Ref x)
            throws SQLException
JDBC 2.0 Sets a parameter to a REF(<structured-type>) object. This method is not supported.
Specified by:
setRef in interface PreparedStatement
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second is 2, and so on.
x - An object representing data of an SQL REF Type .
Throws:
SQLException - This exception is always thrown as SAS software does not support REF SQL type.

setBlob

public void setBlob(int parameterIndex,
                    Blob x)
             throws SQLException
JDBC 2.0 Sets a parameter to a BLOB object. This method is not supported.
Specified by:
setBlob in interface PreparedStatement
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second is 2, and so on.
x - An object representing a BLOB.
Throws:
SQLException - This exception is always thrown as SAS software does not support BLOB SQL type.

setClob

public void setClob(int parameterIndex,
                    Clob x)
             throws SQLException
JDBC 2.0 Sets a parameter to a CLOB object. This method is not supported.
Specified by:
setClob in interface PreparedStatement
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second is 2, and so on.
x - An object representing a CLOB.
Throws:
SQLException - This exception is always thrown as SAS software does not support CLOB SQL type.

setArray

public void setArray(int parameterIndex,
                     Array x)
              throws SQLException
JDBC 2.0 Sets a parameter to an Array object. This method is not supported.
Specified by:
setArray in interface PreparedStatement
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second is 2, and so on.
x - An object representing an SQL array.
Throws:
SQLException - This exception is always thrown as SAS software does not support Array SQL type.

getMetaData

public ResultSetMetaData getMetaData()
                              throws SQLException
JDBC 2.0 Gets the number, types and properties of a ResultSet's columns as a ResultSetMetaData object.
Specified by:
getMetaData in interface PreparedStatement
Returns:
The description of a ResultSet's columns as a ResultSetMetaData object.
Throws:
SQLException - This exception is thrown if a database error occurs or if the result set is NULL.

setDate

public void setDate(int parameterIndex,
                    Date x,
                    Calendar cal)
             throws SQLException
JDBC 2.0 Sets a parameter to a java.sql.Date value.
Specified by:
setDate in interface PreparedStatement
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second is 2, and so on.
x - The parameter value, a java.sql.Date object.
cal - A Calendar object. Ignored if cal is NULL.
Throws:
SQLException - This exception is thrown if parameter index is not valid.

setTime

public void setTime(int parameterIndex,
                    Time x,
                    Calendar cal)
             throws SQLException
JDBC 2.0 Sets a parameter to a java.sql.Time value.
Specified by:
setTime in interface PreparedStatement
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second is 2, and so on.
x - The parameter value, a java.sql.Time object.
cal - A Calendar object. Ignored if cal is NULL.
Throws:
SQLException - This exception is thrown if parameter index is not valid.

setTimestamp

public void setTimestamp(int parameterIndex,
                         Timestamp x,
                         Calendar cal)
                  throws SQLException
JDBC 2.0 Sets a parameter to a java.sql.Timestamp value.
Specified by:
setTimestamp in interface PreparedStatement
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second is 2, and so on.
x - The parameter value, a java.sql.Timestamp value.
cal - A Calendar object. Ignored if cal is NULL.
Throws:
SQLException - This exception is thrown if parameter index is not valid.

setNull

public void setNull(int parameterIndex,
                    int sqlType,
                    String x)
             throws SQLException
JDBC 2.0 Sets a parameter to SQL NULL. This method is not yet supported.
Specified by:
setNull in interface PreparedStatement
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second parameter is 2, and so on.
sqlType - An SQL type code that is defined by java.sql.Types.
x - An input String.
Throws:
SQLException - This exception is always thrown.

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 String x)
                          throws SQLException
JDBC 2.0 This method is not yet supported.
Parameters:
parameterIndex - The parameter index. The first parameter is 1, the second parameter is 2, and so on.
sqlType - An SQL type code that is defined by java.sql.Types.
x - An input String.
Throws:
SQLException - This exception is always thrown.

getParameterMetaData

public ParameterMetaData getParameterMetaData()
                                       throws SQLException
Retrieves the number, types and properties of this PreparedStatement object's parameters. Empty method implementation for JDK1.4 compliance.
Specified by:
getParameterMetaData in interface PreparedStatement
Throws:
SQLException - Always thrown to indicate that this method is not implemented.

setURL

public void setURL(int parameterIndex,
                   URL x)
            throws SQLException
Sets the designated parameter to the given java.net.URL value. Empty method implementation for JDK1.4 compliance.
Specified by:
setURL in interface PreparedStatement
Throws:
SQLException - Always thrown to indicate that this method is not implemented.



Copyright © 2003 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 09 Jul 2004 16:13:39