com.informix.jdbc

Interface IfmxPreparedStatement

  • All Superinterfaces:
    java.lang.AutoCloseable, java.sql.PreparedStatement, java.sql.Statement, java.sql.Wrapper


    public interface IfmxPreparedStatement
    extends java.sql.PreparedStatement

    Contains extensions to the standard JDBC PreparedStatement interface.

    See Also:
    Connection.prepareStatement(java.lang.String), PreparedStatement, ResultSet
    • 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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void closeWithKey(java.lang.String key)
      Caches the Prepared or Callable statement in the connection object for latest reuse
      java.sql.ResultSet executeQuery(boolean withHold)
      An executeQuery() extension to specify whether the result should be a HOLD ResultSet (cursor) or not.
      java.sql.ResultSet executeQuery(boolean withHold, boolean withReOptimization)
      An database executeQuery() extension to specify whether the result should be a HOLD ResultSet (cursor) or not and if the query plan should be reoptimized if the data for the preparedstatement object has changed.
      void IfxSetObject(int i, java.lang.Object x, int ifxType)
      This method is the same as the setObject() method, except that the driver converts the object to the given IfxType when sending it to the database.
      void setArray(int i, java.sql.Array x, int ifxType)
      Sets an Array parameter.
      void setAsciiStream(int i, java.io.InputStream x, int length, int ifxType)
      When a very large ASCII value is inserted into to a LONGVARCHAR column, it may be more practical to send the ASCII value via a java.io.InputStream.
      void setBigDecimal(int i, java.math.BigDecimal x, int ifxType)
      Sets a parameter to a java.lang.BigDecimal value.
      void setBinaryStream(int i, java.io.InputStream x, int length, int ifxType)
      When a very large binary value is inserted into a LONGVARBINARY column, it may be more practical to send the binary value via a java.io.InputStream.
      void setBlob(int i, java.sql.Blob x, int ifxType)
      Sets a BLOB parameter.
      void setBoolean(int i, boolean x, int ifxType)
      Sets a parameter to a Java boolean value.
      void setByte(int i, byte x, int ifxType)
      Sets a parameter to a Java byte value.
      void setBytes(int i, byte[] x, int ifxType)
      Sets a parameter to a Java array of bytes.
      void setCharacterStream(int i, java.io.Reader x, int length, int ifxType)
      When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader.
      void setClob(int i, java.sql.Clob x, int ifxType)
      Sets a CLOB parameter.
      void setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal, int ifxType)
      Sets a parameter to a java.sql.Date value.
      void setDate(int i, java.sql.Date x, int ifxType)
      Sets a parameter to a java.sql.Date value.
      void setDouble(int i, double x, int ifxType)
      Sets a parameter to a Java double value.
      void setFloat(int i, float x, int ifxType)
      Sets a parameter to a Java float value.
      void setIfxBSONObject(int i, com.informix.jdbc.IfxBSONObject x)
      Sets a parameter to an IfxBSONObject value.
      void setInt(int i, int x, int ifxType)
      Sets a parameter to a Java int value.
      void setInterval(int i, Interval x)
      Sets a parameter to an Interval value.
      void setIntervalDF(int i, IntervalDF x)
      Sets a parameter to an IntervalDF value.
      void setIntervalYM(int i, IntervalYM x)
      Sets a parameter to an IntervalYM value.
      void setLong(int i, long x, int ifxType)
      Sets a parameter to a Java long value.
      void setNull(int i, int sqlType, int ifxType)
      Sets a parameter to SQL NULL.
      void setShort(int i, short x, int ifxType)
      Sets a parameter to a Java short value.
      void setString(int i, java.lang.String x, int ifxType)
      Sets a parameter to a Java String value.
      void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal, int ifxType)
      Sets a parameter to a java.sql.Time value.
      void setTime(int i, java.sql.Time x, int ifxType)
      Sets a parameter to a java.sql.Time value.
      void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal, int ifxType)
      Sets a parameter to a java.sql.Timestamp value.
      void setTimestamp(int i, java.sql.Timestamp x, int ifxType)
      Sets a parameter to a java.sql.Timestamp value.
      java.util.stream.Stream<com.informix.jdbc.IfxBSONObject> stream()
      Executes the PreparedStatment and returns a java Stream of the results as BSON Objects Uses the USE_SPLITERATOR streaming option
      java.util.stream.Stream<com.informix.jdbc.IfxBSONObject> stream(com.informix.jdbc.STREAMS_FETCHING fetchOption)
      Executes the PreparedStatment and returns a java Stream of the results as BSON Objects
      • Methods inherited from interface java.sql.PreparedStatement

        addBatch, clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
      • Methods inherited from interface java.sql.Statement

        addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
      • Methods inherited from interface java.sql.Wrapper

        isWrapperFor, unwrap
    • Method Detail

      • executeQuery

        java.sql.ResultSet executeQuery(boolean withHold)
                                 throws java.sql.SQLException
        An executeQuery() extension to specify whether the result should be a HOLD ResultSet (cursor) or not.
        Parameters:
        withHold - Specifies whether the ResultSet is a HOLD cursor
        Returns:
        A ResultSet that contains the data produced by the query
        Throws:
        java.sql.SQLException
      • setNull

        void setNull(int i,
                     int sqlType,
                     int ifxType)
              throws java.sql.SQLException
        Sets a parameter to SQL NULL.

        Note: You must specify the parameter's SQL type.

        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        sqlType - The SQL type code defined by java.sql.Types.
        ifxType - The SQL data type defined in the IfxTypes class.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setBigDecimal

        void setBigDecimal(int i,
                           java.math.BigDecimal x,
                           int ifxType)
                    throws java.sql.SQLException
        Sets a parameter to a java.lang.BigDecimal value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setBoolean

        void setBoolean(int i,
                        boolean x,
                        int ifxType)
                 throws java.sql.SQLException
        Sets a parameter to a Java boolean value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setByte

        void setByte(int i,
                     byte x,
                     int ifxType)
              throws java.sql.SQLException
        Sets a parameter to a Java byte value. The driver converts this to the given Ifxtype when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setShort

        void setShort(int i,
                      short x,
                      int ifxType)
               throws java.sql.SQLException
        Sets a parameter to a Java short value. The driver converts this to the given Ifxtype when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setInt

        void setInt(int i,
                    int x,
                    int ifxType)
             throws java.sql.SQLException
        Sets a parameter to a Java int value. The driver converts this to the given IfxType value when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setLong

        void setLong(int i,
                     long x,
                     int ifxType)
              throws java.sql.SQLException
        Sets a parameter to a Java long value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setFloat

        void setFloat(int i,
                      float x,
                      int ifxType)
               throws java.sql.SQLException
        Sets a parameter to a Java float value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setDouble

        void setDouble(int i,
                       double x,
                       int ifxType)
                throws java.sql.SQLException
        Sets a parameter to a Java double value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setString

        void setString(int i,
                       java.lang.String x,
                       int ifxType)
                throws java.sql.SQLException
        Sets a parameter to a Java String value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The Informix type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setBytes

        void setBytes(int i,
                      byte[] x,
                      int ifxType)
               throws java.sql.SQLException
        Sets a parameter to a Java array of bytes. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setDate

        void setDate(int i,
                     java.sql.Date x,
                     int ifxType)
              throws java.sql.SQLException
        Sets a parameter to a java.sql.Date value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setTime

        void setTime(int i,
                     java.sql.Time x,
                     int ifxType)
              throws java.sql.SQLException
        Sets a parameter to a java.sql.Time value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setTimestamp

        void setTimestamp(int i,
                          java.sql.Timestamp x,
                          int ifxType)
                   throws java.sql.SQLException
        Sets a parameter to a java.sql.Timestamp value. The driver converts this parameter to the given IfxType when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setAsciiStream

        void setAsciiStream(int i,
                            java.io.InputStream x,
                            int length,
                            int ifxType)
                     throws java.sql.SQLException
        When a very large ASCII value is inserted into to a LONGVARCHAR column, it may be more practical to send the ASCII value via a java.io.InputStream. The JDBC driver reads the data from the stream as needed until it reaches the end-of-file. The JDBC driver does any necessary conversion from ASCII to the given ifxType, if applicable, when sending to the database.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The java input stream that contains the ASCII value.
        length - The number of bytes in the stream.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setBinaryStream

        void setBinaryStream(int i,
                             java.io.InputStream x,
                             int length,
                             int ifxType)
                      throws java.sql.SQLException
        When a very large binary value is inserted into a LONGVARBINARY column, it may be more practical to send the binary value via a java.io.InputStream. The JDBC driver reads the data from the stream as needed until it reaches the end-of-file. The driver converts to the given ifxType, if applicable, when sending to the database.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The java input stream that contains the binary value.
        length - The number of bytes in the stream.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setCharacterStream

        void setCharacterStream(int i,
                                java.io.Reader x,
                                int length,
                                int ifxType)
                         throws java.sql.SQLException
        When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Parameters:
        parameterIndex - the first parameter is 1, the second is 2, ...
        x - the java reader which contains the UNICODE data
        length - the number of characters in the stream
        ifxType - the database type to bind as
        Throws:
        java.sql.SQLException - if a database-access error occurs.
      • setInterval

        void setInterval(int i,
                         Interval x)
                  throws java.sql.SQLException
        Sets a parameter to an Interval value. The driver converts this to an database Interval value when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        Throws:
        java.sql.SQLException
      • setIntervalYM

        void setIntervalYM(int i,
                           IntervalYM x)
                    throws java.sql.SQLException
        Sets a parameter to an IntervalYM value. The driver converts this to an database Interval value when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        Throws:
        java.sql.SQLException
      • setIntervalDF

        void setIntervalDF(int i,
                           IntervalDF x)
                    throws java.sql.SQLException
        Sets a parameter to an IntervalDF value. The driver converts this to an database Interval value when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        Throws:
        java.sql.SQLException
      • IfxSetObject

        void IfxSetObject(int i,
                          java.lang.Object x,
                          int ifxType)
                   throws java.sql.SQLException

        This method is the same as the setObject() method, except that the driver converts the object to the given IfxType when sending it to the database.

        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The object containing the input parameter value.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setBlob

        void setBlob(int i,
                     java.sql.Blob x,
                     int ifxType)
              throws java.sql.SQLException
        Sets a BLOB parameter. The driver converts the parameter to the given IfxType when sending it to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - An object representing a BLOB.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setClob

        void setClob(int i,
                     java.sql.Clob x,
                     int ifxType)
              throws java.sql.SQLException
        Sets a CLOB parameter. The driver converts the parameter to the given IfxType when sending it to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - An object representing a CLOB.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setArray

        void setArray(int i,
                      java.sql.Array x,
                      int ifxType)
               throws java.sql.SQLException
        Sets an Array parameter. The driver converts the parameter to the given IfxType when sending it to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - An object representing an SQL array.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setTime

        void setTime(int parameterIndex,
                     java.sql.Time x,
                     java.util.Calendar cal,
                     int ifxType)
              throws java.sql.SQLException
        Sets a parameter to a java.sql.Time value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        parameterIndex - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        cal - The calendar object the driver uses to construct the time.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setDate

        void setDate(int parameterIndex,
                     java.sql.Date x,
                     java.util.Calendar cal,
                     int ifxType)
              throws java.sql.SQLException
        Sets a parameter to a java.sql.Date value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        parameterIndex - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        cal - The calendar object the driver uses to construct the date.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setTimestamp

        void setTimestamp(int parameterIndex,
                          java.sql.Timestamp x,
                          java.util.Calendar cal,
                          int ifxType)
                   throws java.sql.SQLException
        Sets a parameter to a java.sql.Timestamp value. The driver converts this to the given IfxType when it sends the value to the database.
        Parameters:
        parameterIndex - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        cal - The calendar object the driver uses to construct the timestamp.
        ifxType - The database type to bind as.
        Throws:
        java.sql.SQLException
        See Also:
        IfxTypes
      • setIfxBSONObject

        void setIfxBSONObject(int i,
                              com.informix.jdbc.IfxBSONObject x)
                       throws java.sql.SQLException
        Sets a parameter to an IfxBSONObject value. The driver converts this to an Informix BSON value when it sends the value to the database.
        Parameters:
        i - The first parameter is 1, the second is 2, and so on.
        x - The parameter value.
        Throws:
        java.sql.SQLException
      • executeQuery

        java.sql.ResultSet executeQuery(boolean withHold,
                                        boolean withReOptimization)
                                 throws java.sql.SQLException
        An database executeQuery() extension to specify whether the result should be a HOLD ResultSet (cursor) or not and if the query plan should be reoptimized if the data for the preparedstatement object has changed.
        Parameters:
        withHold - - specifies whether the ResultSet is a HOLD cursor, default false
        withReOptimization - - specifies whether query plan should be reoptimized, default false
        Returns:
        a resultset with the query results
        Throws:
        java.sql.SQLException - if there is a database access error
      • closeWithKey

        void closeWithKey(java.lang.String key)
                   throws java.sql.SQLException
        Caches the Prepared or Callable statement in the connection object for latest reuse
        Parameters:
        key - Key to cache the statement against
        Throws:
        java.sql.SQLException - if there is a database access error
      • stream

        java.util.stream.Stream<com.informix.jdbc.IfxBSONObject> stream()
                                                                 throws java.sql.SQLException
        Executes the PreparedStatment and returns a java Stream of the results as BSON Objects Uses the USE_SPLITERATOR streaming option
        Returns:
        a stream of BSON objects, one for each row
        Throws:
        java.sql.SQLException - if there is a database access error
      • stream

        java.util.stream.Stream<com.informix.jdbc.IfxBSONObject> stream(com.informix.jdbc.STREAMS_FETCHING fetchOption)
                                                                 throws java.sql.SQLException
        Executes the PreparedStatment and returns a java Stream of the results as BSON Objects
        Parameters:
        fetchOption - Whether you fetch the data upfront (PREFETCH) or use a SPLITERATOR
        Returns:
        a stream of BSON objects, one for each row
        Throws:
        java.sql.SQLException