Mimer JDBC Engine 2.12

com.mimer.jdbc
Class PreparedStatement

java.lang.Object
  |
  +--com.mimer.jdbc.Statement
        |
        +--com.mimer.jdbc.PreparedStatement
All Implemented Interfaces:
PreparedStatement, Statement
Direct Known Subclasses:
CallableStatement

public class PreparedStatement
extends Statement
implements PreparedStatement

A PreparedStatement contains a pre-compiled SQL statement which may have parameter markers. The statement may be executed several times with different parameters without having to recompile the SQL syntax.

Statements with output parameters may not be executed using this object.

See ResultSet for information on which Mimer SQL data types may be set with which setter method.


Field Summary
 
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
 
Method Summary
 void addBatch()
          Adds a set of input parameters to a PreparedStatement batch.
 void clearBatch()
          Clears the current batch.
 void clearParameters()
          Clears the currently set parameters.
 void close()
          Closes the PreparedStatement.
 boolean execute()
          Execute the prepared statement with the current set of parameters.
 int[] executeBatch()
          Executing the current batch.
 ResultSet executeQuery()
          Executes a query that returns a result set.
 int executeUpdate()
          Executes an SQL-statement that don't return a result set.
 ResultSetMetaData getMetaData()
          Returns a ResultSetMetaData object describing the result sets that will be returned when this object is executed.
 void setArray(int parameterIndex, Array x)
          Set an SQL array parameter.
 void setAsciiStream(int parameterIndex, InputStream x, int length)
          Sets the specified parameter to the contents of the supplied stream.
 void setBigDecimal(int parameterIndex, BigDecimal x)
          Sets the specified parameter to the contents of the supplied BigDecimal.
 void setBinaryStream(int parameterIndex, InputStream x, int length)
          Sets the specified parameter to the contents of the supplied stream.
 void setBlob(int parameterIndex, Blob x)
          Set an Blob object.
 void setBoolean(int parameterIndex, boolean x)
          Sets a boolean parameter value.
 void setByte(int parameterIndex, byte x)
          Sets the specified column to the value of a byte.
 void setBytes(int parameterIndex, byte[] x)
           
 void setCharacterStream(int parameterIndex, Reader x, int length)
          Sets the specified column to the contents of the supplied stream.
 void setClob(int parameterIndex, Clob x)
          Set a Clob object.
 void setDate(int parameterIndex, Date x)
          Sets the specified column to the value of a Date.
 void setDate(int parameterIndex, Date x, Calendar parm3)
          Set a Date.
 void setDouble(int parameterIndex, double x)
          Sets the specified column to the value of a double.
 void setFloat(int parameterIndex, float x)
          Sets the specified column to the value of a float.
 void setInt(int parameterIndex, int x)
          Sets the specified column to the value of a int.
 void setLong(int parameterIndex, long x)
          Sets the specified column to the value of a long.
 void setNull(int parameterIndex, int sqlType)
          Set a parameter to null.
 void setNull(int parameterIndex, int sqlType, String typeName)
          Set a parameter to null.
 void setObject(int parameterIndex, Object x)
          Sets the specified column to the value of a Object.
 void setObject(int parameterIndex, Object x, int targetSqlType)
          Sets the specified column to the value of a Object.
 void setObject(int parameterIndex, Object x, int targetSqlType, int scale)
          Sets the specified column to the value of a Object.
 void setRef(int parameterIndex, Ref x)
          Set a SQL reference.
 void setShort(int parameterIndex, short x)
          Sets the specified column to the value of a short.
 void setString(int parameterIndex, String x)
          Sets the specified column to the value of string.
 void setTime(int parameterIndex, Time x)
          Sets the specified column to the value of a Time.
 void setTime(int parameterIndex, Time x, Calendar cal)
          Set a Time with time zone compensation.
 void setTimestamp(int parameterIndex, Timestamp x)
          Sets the specified column to the value of a Timestamp.
 void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
          Set a Timestamp.
 void setUnicodeStream(int parameterIndex, InputStream x, int length)
          Sets the specified column to the contents of the supplied stream.
 
Methods inherited from class com.mimer.jdbc.Statement
addBatch, cancel, clearStatement, clearWarnings, execute, executeQuery, executeUpdate, getConnection, getFetchDirection, getFetchSize, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetType, 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.PreparedStatement
getParameterMetaData, setURL
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearWarnings, execute, execute, execute, execute, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Method Detail

addBatch

public void addBatch()
              throws SQLException
Adds a set of input parameters to a PreparedStatement batch.

See Statement.addBatch for a discussion on the difference between Statement batches and PreparedStatement batches.

Specified by:
addBatch in interface PreparedStatement
Throws:
SQLException - if an error occurs. If the PreparedStatement object is not open, SQLSTATE HY010 is thrown. HY010 is also thrown when the PreparedStatement is not an INSERT, UPDATE or DELETE SQL statement.

See Also:
executeBatch()

clearBatch

public void clearBatch()
                throws SQLException
Clears the current batch.

Specified by:
clearBatch in interface Statement
Overrides:
clearBatch in class Statement
Throws:
SQLException - if an error occurs. If the Statement object is closed, SQLSTATE HY010 is thrown.
See Also:
addBatch(java.lang.String), executeBatch()

clearParameters

public void clearParameters()
                     throws SQLException
Clears the currently set parameters.

Specified by:
clearParameters in interface PreparedStatement
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement wasn't open.

close

public void close()
           throws SQLException
Closes the PreparedStatement.

Specified by:
close in interface Statement
Overrides:
close in class Statement
Throws:
SQLException - if an error occurs.

execute

public boolean execute()
                throws SQLException
Execute the prepared statement with the current set of parameters.

Specified by:
execute in interface PreparedStatement
Returns:
True if a result set was returned. If so use the getResultSet method to obtain the ResultSet object.
Throws:
SQLException - if an error occurs. HY010 is thrown if the statement is not open, or if there where batches added to this PreparedStatement. HY000 is thrown if the statement contains parameter markers, in this case you must use a PreparedStatement object instead. HY000 may also be thrown when the SQL statement was not supported by the driver, see Statement for an overview on which statements that are not supported and why. 42000 is thrown if the SQL contained a syntax error. 34000 is thrown if a UPDATE/DELETE WHERE CURRENT OF specified a cursor that doesn't exist. S1008 is thrown if the execution is cancelled.
See Also:
executeUpdate(java.lang.String), executeQuery(java.lang.String), Statement.getResultSet()

executeBatch

public int[] executeBatch()
                   throws SQLException
Executing the current batch.

Specified by:
executeBatch in interface Statement
Overrides:
executeBatch in class Statement
Returns:
An integer array containing update counts of each set of parameter.
Throws:
SQLException - if an error occurs. If the PreparedStatement object is not open, SQLSTATE HY010 is thrown. This call may execute a lot of server side code and may return any server runtime error. S1008 is thrown if the execution is cancelled.
See Also:
addBatch(java.lang.String)

executeQuery

public ResultSet executeQuery()
                       throws SQLException
Executes a query that returns a result set.

Specified by:
executeQuery in interface PreparedStatement
Returns:
The update count.
Throws:
SQLException - if an error occurs. HY010 is thrown if the statement is not open. HY000 is thrown if the statement contains parameter markers, in this case you must use a PreparedStatement object instead. HY000 may also be thrown when the SQL statement was not supported by the driver, see Statement for an overview on which statements that are not supported and why. 42000 is thrown if the SQL contained a syntax error or the statement wasn't a query. 34000 is thrown if a UPDATE/DELETE WHERE CURRENT OF specified a cursor that doesn't exist. S1008 is thrown if the execution is cancelled.
See Also:
executeUpdate(java.lang.String), execute(java.lang.String)

executeUpdate

public int executeUpdate()
                  throws SQLException
Executes an SQL-statement that don't return a result set.

Specified by:
executeUpdate in interface PreparedStatement
Returns:
The update count.
Throws:
SQLException - if an error occurs. HY010 is thrown if the statement is not open. HY000 is thrown if the statement contains parameter markers, in this case you must use a PreparedStatement object instead. HY000 may also be thrown when the SQL statement was not supported by the driver, see Statement for an overview on which statements that are not supported and why. 42000 is thrown if the SQL contained a syntax error or the statement was a query. 34000 is thrown if a UPDATE/DELETE WHERE CURRENT OF specified a cursor that doesn't exist. S1008 is thrown if the execution is cancelled.
See Also:
executeQuery(java.lang.String), execute(java.lang.String)

getMetaData

public ResultSetMetaData getMetaData()
                              throws SQLException
Returns a ResultSetMetaData object describing the result sets that will be returned when this object is executed.

A ResultSetMetaData object is always internally created at the same time the PreparedStatement object is created. This method simply returns this object.

Specified by:
getMetaData in interface PreparedStatement
Returns:
The ResultSetMetaData object. If the PreparedStatement was not a query, null is returned.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open.

setArray

public void setArray(int parameterIndex,
                     Array x)
              throws SQLException
Set an SQL array parameter.

Mimer SQL (as of 9.2) does not support SQL arrays. This method will always throw an error.

Specified by:
setArray in interface PreparedStatement
Parameters:
parameterIndex - The column index.
x - The SQL array.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 2200G is thrown if the column type wasn't castable from a SQL array, see {link ResultSet} for an overview of which Java types are castable to which SQL types.

setAsciiStream

public void setAsciiStream(int parameterIndex,
                           InputStream x,
                           int length)
                    throws SQLException
Sets the specified parameter to the contents of the supplied stream.

Specified by:
setAsciiStream in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The data.
length - The length of the data. This is ignored for all parameter types except CLOB:s. When inserting CLOB data, the server want to know the length of the data in advance. There is no way to use this method to insert CLOB:s larger than 2 GB. To insert larger CLOB:s, use Clob objects instead which from JDBC 3 includes methods for this.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22001 if the stream was shorter than specified. HY000 if there was a read eror in the supplied InputStream.
DataTruncation - if the input stream was longer than the parameter could hold.

setBigDecimal

public void setBigDecimal(int parameterIndex,
                          BigDecimal x)
                   throws SQLException
Sets the specified parameter to the contents of the supplied BigDecimal.

Specified by:
setBigDecimal in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The data.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22003 if the server data type was a numeric data type and the value was larger than the data type could hold. 22001 if the server data type was a character string and the value could not be fitted into the string.

setBinaryStream

public void setBinaryStream(int parameterIndex,
                            InputStream x,
                            int length)
                     throws SQLException
Sets the specified parameter to the contents of the supplied stream.

Specified by:
setBinaryStream in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The data.
length - The length of the data in bytes. This is ignored for all parameter types except BLOB:s. When inserting BLOB data, the server want to know the length of the data in advance. There is no way to use this method to insert BLOB:s larger than 2 GB. To insert larger BLOB:s, use Blob objects instead which from JDBC 3 includes methods for this.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22001 if the stream was shorter than specified. HY000 if there was a read eror in the supplied InputStream.
DataTruncation - if the input stream was longer than the parameter could hold.

setBlob

public void setBlob(int parameterIndex,
                    Blob x)
             throws SQLException
Set an Blob object.

Specified by:
setBlob in interface PreparedStatement
Parameters:
parameterIndex - The column index.
x - The Blob object.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 2200G is thrown if the column type wasn't castable from a Blob object, see {link ResultSet} for an overview of which Java types are castable to which SQL types.

setBoolean

public void setBoolean(int parameterIndex,
                       boolean x)
                throws SQLException
Sets a boolean parameter value.

Mimer SQL does not support a SQL BOOLEAN data type. When the setBoolean is used to set parameter values, the following values will be used:
truefalse
character data types"true""false"
numerical data types10

Specified by:
setBoolean in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The boolean value.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22003 if the server data type was a numeric data type and the value was larger than the data type could hold. 22001 if the server data type was a character string and the value could not be fitted into the string.

setByte

public void setByte(int parameterIndex,
                    byte x)
             throws SQLException
Sets the specified column to the value of a byte.

Specified by:
setByte in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The byte.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22003 if the server data type was a numeric data type and the value was larger than the data type could hold. 22001 if the server data type was a character string and the value could not be fitted into the string.

setBytes

public void setBytes(int parameterIndex,
                     byte[] x)
              throws SQLException
Specified by:
setBytes in interface PreparedStatement
SQLException

setCharacterStream

public void setCharacterStream(int parameterIndex,
                               Reader x,
                               int length)
                        throws SQLException
Sets the specified column to the contents of the supplied stream.

If the parameter type is a latin1-based character string and the stream contains characters that cannot be converted to a latin1 (ISO 8859-1) based string, an SQLException is thrown.

Specified by:
setCharacterStream in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The data.
length - The length of the input stream in characters. This is ignored for all parameter types except CLOB:s. When inserting CLOB data, the server want to know the length of the data in advance. There is no way to use this method to insert CLOB:s larger than 2 GB. JDBC 3 offers a a way to work with objects larger than 2 GB through the Clob object.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 2200G is thrown if the column type wasn't castable from a character stream, see {link ResultSet} for an overview of which Java types are castable to which SQL types.

setClob

public void setClob(int parameterIndex,
                    Clob x)
             throws SQLException
Set a Clob object.

Specified by:
setClob in interface PreparedStatement
Parameters:
parameterIndex - The column index.
x - The Clob object.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 2200G is thrown if the column type wasn't castable from a Clob object, see {link ResultSet} for an overview of which Java types are castable to which SQL types.

setDate

public void setDate(int parameterIndex,
                    Date x)
             throws SQLException
Sets the specified column to the value of a Date.

Specified by:
setDate in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The Date.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22001 if the server data type was a character string and the value could not be fitted into the string.

setDate

public void setDate(int parameterIndex,
                    Date x,
                    Calendar parm3)
             throws SQLException
Set a Date.

Specified by:
setDate in interface PreparedStatement
Parameters:
parameterIndex - The column index.
x - The date.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 2200G is thrown if the column type wasn't castable from a Date object, see {link ResultSet} for an overview of which Java types are castable to which SQL types.

setDouble

public void setDouble(int parameterIndex,
                      double x)
               throws SQLException
Sets the specified column to the value of a double.

Specified by:
setDouble in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The double.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22003 if the server data type was a numeric data type and the value was larger than the data type could hold. 22001 if the server data type was a character string and the value could not be fitted into the string.

setFloat

public void setFloat(int parameterIndex,
                     float x)
              throws SQLException
Sets the specified column to the value of a float.

Specified by:
setFloat in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The float.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22003 if the server data type was a numeric data type and the value was larger than the data type could hold. 22001 if the server data type was a character string and the value could not be fitted into the string.

setInt

public void setInt(int parameterIndex,
                   int x)
            throws SQLException
Sets the specified column to the value of a int.

Specified by:
setInt in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The int.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22003 if the server data type was a numeric data type and the value was larger than the data type could hold. 22001 if the server data type was a character string and the value could not be fitted into the string.

setLong

public void setLong(int parameterIndex,
                    long x)
             throws SQLException
Sets the specified column to the value of a long.

Specified by:
setLong in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The long.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22003 if the server data type was a numeric data type and the value was larger than the data type could hold. 22001 if the server data type was a character string and the value could not be fitted into the string.

setNull

public void setNull(int parameterIndex,
                    int sqlType)
             throws SQLException
Set a parameter to null.

Specified by:
setNull in interface PreparedStatement
Parameters:
parameterIndex - The column index.
sqlType - The SQL type of the column. A value from Types.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 23000 is thrown if the parameter wasn't nullable.

setNull

public void setNull(int parameterIndex,
                    int sqlType,
                    String typeName)
             throws SQLException
Set a parameter to null.

This version of the setNull is supposed to be used on user-defined types and REF type parameters. Mimer SQL servers up until 9.2 including this driver does not support these SQL datatypes. The sqlType and typeName parameters are ignored.

Specified by:
setNull in interface PreparedStatement
Parameters:
parameterIndex - The column index.
sqlType - The SQL type of the column. A value from Types.
typeName - The name of the type.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 23000 is thrown if the parameter wasn't nullable.

setObject

public void setObject(int parameterIndex,
                      Object x)
               throws SQLException
Sets the specified column to the value of a Object.

Specified by:
setObject in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The object.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. This method may throw most SQLSTATE:s thrown by the other setter methods of this object.

setObject

public void setObject(int parameterIndex,
                      Object x,
                      int targetSqlType)
               throws SQLException
Sets the specified column to the value of a Object.

Specified by:
setObject in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The object.
targetSqlType -
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. This method may throw most SQLSTATE:s thrown by the other setter methods of this object.

setObject

public void setObject(int parameterIndex,
                      Object x,
                      int targetSqlType,
                      int scale)
               throws SQLException
Sets the specified column to the value of a Object.

Specified by:
setObject in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The object.
targetSqlType -
scale -
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. This method may throw most SQLSTATE:s thrown by the other setter methods of this object.

setRef

public void setRef(int parameterIndex,
                   Ref x)
            throws SQLException
Set a SQL reference.

Mimer SQL servers up until 9.2 including this driver does not support SQL references. This method always throw an exception.

Specified by:
setRef in interface PreparedStatement
Parameters:
parameterIndex - The column index.
x - The reference.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 2200G is thrown if the column type wasn't castable from a Ref object, see {link ResultSet} for an overview of which Java types are castable to which SQL types.

setShort

public void setShort(int parameterIndex,
                     short x)
              throws SQLException
Sets the specified column to the value of a short.

Specified by:
setShort in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The short.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22003 if the server data type was a numeric data type and the value was larger than the data type could hold. 22001 if the server data type was a character string and the value could not be fitted into the string.

setString

public void setString(int parameterIndex,
                      String x)
               throws SQLException
Sets the specified column to the value of string.

Specified by:
setString in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The String
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22003 if the server data type was a numeric data type and the value was larger than the data type could hold. 22001 if the server data type was a character string and the value could not be fitted into the string.

setTime

public void setTime(int parameterIndex,
                    Time x)
             throws SQLException
Sets the specified column to the value of a Time.

Specified by:
setTime in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The Time.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22001 if the server data type was a character string and the value could not be fitted into the string.

setTime

public void setTime(int parameterIndex,
                    Time x,
                    Calendar cal)
             throws SQLException
Set a Time with time zone compensation.

Specified by:
setTime in interface PreparedStatement
Parameters:
parameterIndex - The column index.
x - The time.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 2200G is thrown if the column type wasn't castable from a Time object, see {link ResultSet} for an overview of which Java types are castable to which SQL types.

setTimestamp

public void setTimestamp(int parameterIndex,
                         Timestamp x)
                  throws SQLException
Sets the specified column to the value of a Timestamp.

Specified by:
setTimestamp in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The Timestamp.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the parameter does not exist. HY010 if the PreparedStatement is not open. 2200G if this method can't be used to convert to the server data type. 22001 if the server data type was a character string and the value could not be fitted into the string.

setTimestamp

public void setTimestamp(int parameterIndex,
                         Timestamp x,
                         Calendar cal)
                  throws SQLException
Set a Timestamp.

Specified by:
setTimestamp in interface PreparedStatement
Parameters:
parameterIndex - The column index.
x - The timestamp.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the PreparedStatement is not open. 07009 is thrown if the parameterIndex is not valid. 2200G is thrown if the column type wasn't castable from a Timestamp object, see {link ResultSet} for an overview of which Java types are castable to which SQL types.

setUnicodeStream

public void setUnicodeStream(int parameterIndex,
                             InputStream x,
                             int length)
                      throws SQLException
Sets the specified column to the contents of the supplied stream.

If the parameter type is a latin1-based character string and the stream contains characters that cannot be converted to a latin1 (ISO 8859-1) based string, an SQLException is thrown.

Specified by:
setUnicodeStream in interface PreparedStatement
Parameters:
parameterIndex - The parameter number.
x - The data.
length - The length of the input stream in bytes. This is ignored for all parameter types except CLOB:s. When inserting CLOB data, the server want to know the length of the data in advance. There is no way to use this method to insert CLOB:s larger than 2 GB. JDBC 3 offers a a way to supply objects larger than 2 GB through the Clob object.
SQLException

Mimer JDBC Engine 2.12

Submit a comment or suggestion Version 2.12 of Mimer JDBC Engine
Copyright Upright Database Technology AB, Box 1713, SE-751 47 UPPSALA, Sweden. All Rights Reserved.