com.informix.jdbc

## Interface IfxProtocol

All Known Implementing Classes:
  IfxSqli, IfxXASqli

    public interface IfxProtocol

IfxProtocol represents the protocol and data exchange between the client and an Informix database server. It sends and processes the messages and the data flow between the client and server.

See Also:
  `Connection`, `ResultSet`

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `chainWarnings(java.sql.SQLWarning cwarn)` Chain the given SQLWarning to the current instance.
`void` `clear()` Clear member values.
`void` `clearExceptions()` Clear the SQLException chain in the current instance.
`void` `clearWarnings()` Clear the SQLWarning chain in the current instance.
`int` `decRefCount(byte[] locator)` Decrements refcount of a large object
`void` `executeBegin()` Begin a transaction on the server
`void` `executeClose(java.sql.Statement stmt)` Close an open cursor on the server.
`void` `executeCloseDatabase()` Close the current database on the server
`void` `executeCommand(java.sql.Statement stmt)` Execute a SQL INSERT, UPDATE or DELETE statements on the server.
`void` `executeCommit()` Commit a transaction on the server
`IfxResultSetMetaData` `executeDescribeInput()` Execute DESCRIBE INPUT command
`void` `executeEnv(java.util.Properties EnvVars)` Send the secondary environment variable list to the server.
`void` `executeExecute(java.sql.Statement stmt, boolean holdable, boolean withReOptimized)` Exceute a SQL statement on the server.
`void` `executeExecute(java.sql.Statement stmt, boolean holdable, boolean withReOptimized, java.sql.ResultSetMetaData outputMetaData)` Exceute a SQL statement on the server.
`java.util.Vector<IfxObject>` `executeFastPath(java.lang.String signature, java.util.Vector<IfxObject> inParams, boolean fParam)` returns a vector of values resulting from executing a UDR on the server
`void` `executeFastPath(java.lang.String signature, java.util.Vector<IfxObject> inParams, boolean outParam, boolean fParam)` Executing a UDR on the server.
`void` `executeFetchBlob(IfxObject obj)` Fetch the blob contents.
`IfxResultSetMetaData` `executeFPDescribe(java.lang.String signature, boolean isProc, java.lang.String procName, int numargs)`
`void` `executeGetDBList()` Gets the list of databases on the server to which we are connected
`void` `executeOpenDatabase(java.lang.String dbName, int flags)` Opens a database.
`void` `executePrepare(java.sql.Statement stmt)` Prepare an SQL statement on the server.
`void` `executeProtocols(byte[] protocols)`
`int` `executeReadSmBlob(int loFd, byte[] buffer, int nbytes)` Read the Smart blob contents.
`int` `executeReadSmBlob(int loFd, byte[] buffer, int nbytes, int offset)` Read the Smart blob contents.
`int` `executeReadSmBlob(int lofd, java.io.FileOutputStream fileFd, int nbytes)` Read the Smart blob contents
`void` `executeRelease(int id)`
`void` `executeRelease(java.sql.Statement stmt)` Release the database resource previously allocated for this statement.
`void` `executeReleaseSavepoint(java.lang.String sv)` Release Savepoint on the server
`void` `executeRollback()` Rollback a transaction on the server
`void` `executeRollbackSavepoint(java.lang.String sv)` Set Savepoint on the server
`void` `executeSavepoint(java.lang.String sv, boolean uniqFlag)` Set Savepoint on the server
`void` `executeStatementQuery(java.sql.Statement stmt)` Execute a Query on the server.
`void` `executeStatementQuery(java.sql.Statement stmt, boolean withHold, boolean withReOptimization)` protected method to do the executeQuery for Statement objects and PreparedStatements.
`void` `executeStatementQuery(java.sql.Statement stmt, boolean withHold, boolean withReOptimization, java.sql.ResultSetMetaData outputMetaData)` Execute a Query on the server.
`void` `executeVersion()` Get the version number from the server.
`int` `executeWriteSmBlob(int loFd, byte[] buffer)` Write into the Smart blob
`int` `executeWriteSmBlob(int loFd, byte[] buffer, int offset, int length)`
`int` `executeWriteSmBlob(int loFd, java.io.InputStream fd, int length)` Write into the Smart blob
`boolean` `getaRow(int direction, int count, int scrolltype, int isscrollcurs, java.sql.Statement stmt)` Move the cursor from the current position to +/- count depending on the direction specified.
`long` `getBigSerialInserted()` Retrieve the last bigserial value inserted returned by SQ_INSERTDONE
`IfxObject` `getColumnInRow(int colIndex)` Get the value of a column in the current row in IfxObject.
`java.util.Vector<java.lang.String>` `getDBList()` Returns the Vector in which database names are stored.
`int` `getEstimateNumberofRow()` Get the estimated number of rows returned by the server
`com.informix.jdbc.IfxFParam` `getFParam()` Return the fparam data from a fast path call.
`java.util.Vector<IfxObject>` `getFPReturnVector()` Return the return values from a fast path call.
`java.sql.ResultSetMetaData` `getMetaData()` Return an ResultSetMetaData object.
`int` `getNumberOfRowsProcessed()` Get the number of rows processed as a result of executing the current INSERT/UPDATE/DELETE statement.
`byte[]` `getProtocols()`
`long` `getSerial8Inserted()` Retrieve the last serial8 value inserted returned by SQ_INSERTDONE
`int` `getSerialInsert()` Serial value after an insert sent in IfxMessageTypes.SQ_DONE message.
`java.lang.String` `getServerVersion()` Return the server version number retrieved by executeVersion().
`int` `getStatementType()` getStatementType() returns the statement type for the statement prepared.
`int` `getTupid()` getTupid() returns the Tuple ID for scroll cursors.
`int` `getTupleCount()` Return the number of tuples in the tuple vector.
`int` `getTupleSize()` Get the actual tuple size of the current tuple that the cursor is pointing at.
`java.sql.SQLWarning` `getWarnings()` Get the SQLWarning chain from the current instance.
`void` `handlePAMAuthentication(java.lang.String cn)`
`boolean` `handlePrivateServerExchange()`
`int` `incRefCount(byte[] locator)` Increments refcount of a large object
`boolean` `isResultSet()` Check to see if the current statement executed returned a ResultSet.
`void` `loadColumnData(int colIndex, IfxObject val)` Load data value of a column in the current row into the given IfxObject.

### Method Detail

#### getMetaData

    java.sql.ResultSetMetaData getMetaData()

Return an ResultSetMetaData object.

Returns:
  ResultSetMetaData

#### clear

    void clear()

Clear member values.

#### executeBegin

    void executeBegin()
               throws java.sql.SQLException

Begin a transaction on the server

Throws:
  `java.sql.SQLException`

#### executeCommit

    void executeCommit()
                throws java.sql.SQLException

Commit a transaction on the server

Throws:
  `java.sql.SQLException`

#### executeRollback

    void executeRollback()
                  throws java.sql.SQLException

Rollback a transaction on the server

Throws:
  `java.sql.SQLException`

#### executeSavepoint

    void executeSavepoint(java.lang.String sv,
                          boolean uniqFlag)
                   throws java.sql.SQLException

Set Savepoint on the server

Throws:
  `java.sql.SQLException`

#### executeReleaseSavepoint

    void executeReleaseSavepoint(java.lang.String sv)
                          throws java.sql.SQLException

Release Savepoint on the server

Throws:
  `java.sql.SQLException`

#### executeRollbackSavepoint

    void executeRollbackSavepoint(java.lang.String sv)
                           throws java.sql.SQLException

Set Savepoint on the server

Throws:
  `java.sql.SQLException`

#### executeCloseDatabase

    void executeCloseDatabase()
                       throws java.sql.SQLException

Close the current database on the server

Throws:
  `java.sql.SQLException`

#### executeVersion

    void executeVersion()
                 throws java.sql.SQLException

Get the version number from the server.

Throws:
  `java.sql.SQLException`

#### getServerVersion

    java.lang.String getServerVersion()
                               throws java.sql.SQLException

Return the server version number retrieved by executeVersion().

Returns:
  server version number
Throws:
  `java.sql.SQLException`

#### executeProtocols

    void executeProtocols(byte[] protocols)
                   throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getProtocols

    byte[] getProtocols()

#### handlePAMAuthentication

    void handlePAMAuthentication(java.lang.String cn)
                          throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### executeCommand

    void executeCommand(java.sql.Statement stmt)
                 throws java.sql.SQLException

Execute a SQL INSERT, UPDATE or DELETE statements on the server. In additions, SQL statements that returns nothing such as DDLs can also be executed via this method.

Parameters:
  `stmt` - Statement object
Throws:
  `java.sql.SQLException`

#### executePrepare

    void executePrepare(java.sql.Statement stmt)
                 throws java.sql.SQLException

Prepare an SQL statement on the server.

Parameters:
  `stmt` - Statement object
Throws:
  `java.sql.SQLException`

#### executeStatementQuery

    void executeStatementQuery(java.sql.Statement stmt)
                        throws java.sql.SQLException

Execute a Query on the server. The statement could potentially returns one or more rows of data. This method will open an cursor that points to the returned rows of data.

Parameters:
  `stmt` - Statement object
Throws:
  `java.sql.SQLException`

#### executeStatementQuery

    void executeStatementQuery(java.sql.Statement stmt,
                               boolean withHold,
                               boolean withReOptimization)
                        throws java.sql.SQLException

protected method to do the executeQuery for Statement objects and PreparedStatements. If withHold is true then SQ_HOLD message will be sent to the server.

Parameters:
  `withHold` - , boolean hold cursor over execution
  `withReOptimization,` - boolean if query plan needs to be reoptimized (SQ_REOPTOPEN instead of SQ_OPEN)
  `stmt` - Statement object
Throws:
  `java.sql.SQLException`

#### executeStatementQuery

    void executeStatementQuery(java.sql.Statement stmt,
                               boolean withHold,
                               boolean withReOptimization,
                               java.sql.ResultSetMetaData outputMetaData)
                        throws java.sql.SQLException

Execute a Query on the server. The statement could potentially returns one or more rows of data. This method will open an cursor that points to the returned rows of data.

Parameters:
  `stmt` - Statement object
  `withHold` - , boolean hold cursor over execution
  `withReOptimization,` - boolean if query plan needs to be reoptimized (SQ_REOPTOPEN instead of SQ_OPEN)
  `outputMetaData` - Meta data describing the output host variable types.
Throws:
  `java.sql.SQLException`

#### executeClose

    void executeClose(java.sql.Statement stmt)
               throws java.sql.SQLException

Close an open cursor on the server.

Parameters:
  `stmt` - Statement object
Throws:
  `java.sql.SQLException`

#### executeRelease

    void executeRelease(java.sql.Statement stmt)
                 throws java.sql.SQLException

Release the database resource previously allocated for this statement.

Parameters:
  `stmt` - Statement object
Throws:
  `java.sql.SQLException`

#### executeExecute

    void executeExecute(java.sql.Statement stmt,
                        boolean holdable,
                        boolean withReOptimized)
                 throws java.sql.SQLException

Exceute a SQL statement on the server. The statement can be any DDL, INSERT, UPDATE, DELETE statements or any query statements that can potentially return one or more rows of data. If the statement returns one or more rows of data, a cursor will be opened and point to the returned rows of date.

Parameters:
  `holdable` -
  `withReOptimized` -
  `stmt` - Statement object
Throws:
  `java.sql.SQLException`

#### executeExecute

    void executeExecute(java.sql.Statement stmt,
                        boolean holdable,
                        boolean withReOptimized,
                        java.sql.ResultSetMetaData outputMetaData)
                 throws java.sql.SQLException

Exceute a SQL statement on the server. The statement can be any DDL, INSERT, UPDATE, DELETE statements or any query statements that can potentially return one or more rows of data. If the statement returns one or more rows of data, a cursor will be opened and point to the returned rows of date.

Parameters:
  `stmt` -
  `holdable` -
  `withReOptimized` -
  `outputMetaData` -
Throws:
  `java.sql.SQLException`

#### executeFetchBlob

    void executeFetchBlob(IfxObject obj)
                   throws java.sql.SQLException

Fetch the blob contents. The blob contents might be fetched on demand as the user use getXXXStream() to read the data.

Parameters:
  `obj` - IfxObject that converts data from/to informix/java values
Throws:
  `java.sql.SQLException`

#### executeReadSmBlob

    int executeReadSmBlob(int loFd,
                          byte[] buffer,
                          int nbytes)
                   throws java.sql.SQLException

Read the Smart blob contents.

Parameters:
  `loFd` - Smart blob handle as returned by the server.
  `buffer[]` - buffer to read.
  `nbytes` - no. of bytes to read.
Throws:
  `SQLException.`
  `java.sql.SQLException`

#### executeReadSmBlob

    int executeReadSmBlob(int loFd,
                          byte[] buffer,
                          int nbytes,
                          int offset)
                   throws java.sql.SQLException

Read the Smart blob contents.

Parameters:
  `loFd` - Smart blob handle as returned by the server.
  `buffer[]` - buffer to read.
  `nbytes` - no. of bytes to read.
  `offset` - start offset of data
Throws:
  `SQLException.`
  `java.sql.SQLException`

#### executeReadSmBlob

    int executeReadSmBlob(int lofd,
                          java.io.FileOutputStream fileFd,
                          int nbytes)
                   throws java.sql.SQLException

Read the Smart blob contents

Parameters:
  `loFd` - Smart blob handle as returned by the server.
  `fileFd` - FileOutputStream to read.
  `nbytes` - no. of bytes to read.
Throws:
  `SQLException.`
  `java.sql.SQLException`

#### executeWriteSmBlob

    int executeWriteSmBlob(int loFd,
                           byte[] buffer)
                    throws java.sql.SQLException

Write into the Smart blob

Parameters:
  `loFd` - Smart blob handle as returned by the server.
  `byte[]` - bufferto write.
Throws:
  `SQLException.`
  `java.sql.SQLException`

#### executeWriteSmBlob

    int executeWriteSmBlob(int loFd,
                           byte[] buffer,
                           int offset,
                           int length)
                    throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### executeWriteSmBlob

    int executeWriteSmBlob(int loFd,
                           java.io.InputStream fd,
                           int length)
                    throws java.sql.SQLException

Write into the Smart blob

Parameters:
  `loFd` - Smart blob handle as returned by the server.
  `fd` - InputStream to write.
  `length` - no. of bytes to read.
Throws:
  `SQLException.`
  `java.sql.SQLException`

#### getEstimateNumberofRow

    int getEstimateNumberofRow()

Get the estimated number of rows returned by the server

Returns:
  estimated number of rows returned

#### getNumberOfRowsProcessed

    int getNumberOfRowsProcessed()

Get the number of rows processed as a result of executing the current INSERT/UPDATE/DELETE statement.

Returns:
  number of rows processed

#### chainWarnings

    void chainWarnings(java.sql.SQLWarning cwarn)

Chain the given SQLWarning to the current instance.

Parameters:
  `cwarn` - the SQLWarning instance to be chained.

#### clearWarnings

    void clearWarnings()

Clear the SQLWarning chain in the current instance.

#### clearExceptions

    void clearExceptions()

Clear the SQLException chain in the current instance.

#### getWarnings

    java.sql.SQLWarning getWarnings()

Get the SQLWarning chain from the current instance.

Returns:
  the SQLWarning chain.

#### executeEnv

    void executeEnv(java.util.Properties EnvVars)
             throws java.sql.SQLException

Send the secondary environment variable list to the server.

Throws:
  `java.sql.SQLException`

#### getTupleSize

    int getTupleSize()
              throws java.sql.SQLException

Get the actual tuple size of the current tuple that the cursor is pointing at.

Returns:
  the tuple size
Throws:
  `java.sql.SQLException`
See Also:
  `getTuple`

#### getaRow

    boolean getaRow(int direction,
                    int count,
                    int scrolltype,
                    int isscrollcurs,
                    java.sql.Statement stmt)
             throws java.sql.SQLException

Move the cursor from the current position to +/- count depending on the direction specified. If direction is ResultSet.FETCH_FORWARD, then advance the current position to current + count. If direction is ResultSet.FETCH_REVERSE, then move the current position to current - count. FETCH_FORWARD/FETCH_REVERSE are from JDBC 2.0 support for scrollable cursors.

Parameters:
  `direction` - Valid values are FETCH_FORWARD/FETCH_REVERSE. For JDBC 1.2, only FETCH_FORWARD is supported.
  `count` - number of rows to move forward/backward. For JDBC 1.2, count can only be set to 1.
  `scrolltype` - either absolute, relative, next, ... etc.
  `isscrollcurs` - - is it a scroll cursor ?
  `stmt` - - used eventually to see if the user is changing the return type of the data. See executeScrollFetch().
Returns:
  true if a valid row is found, false otherwise.
Throws:
  `java.sql.SQLException`

#### getColumnInRow

    IfxObject getColumnInRow(int colIndex)
                      throws java.sql.SQLException

Get the value of a column in the current row in IfxObject. Data in the column is automatically loaded into the IfxObject returned.

Parameters:
  `colIndex` - index of column in the row, 1 being the first column.
Returns:
  column value in IfxObject
Throws:
  `java.sql.SQLException`

#### loadColumnData

    void loadColumnData(int colIndex,
                        IfxObject val)
                 throws java.sql.SQLException

Load data value of a column in the current row into the given IfxObject.

Parameters:
  `colIndex` - index of column in the row, 1 being the first column.
  `IfxObject` - to load data into.
Throws:
  `java.sql.SQLException`

#### isResultSet

    boolean isResultSet()
                 throws java.sql.SQLException

Check to see if the current statement executed returned a ResultSet.

Returns:
  true if the current statement returned a ResultSet. false otherwise.
Throws:
  `java.sql.SQLException`

#### getSerial8Inserted

    long getSerial8Inserted()

Retrieve the last serial8 value inserted returned by SQ_INSERTDONE

#### getSerialInsert

    int getSerialInsert()

Serial value after an insert sent in IfxMessageTypes.SQ_DONE message.

#### getTupid

    int getTupid()
          throws java.sql.SQLException

getTupid() returns the Tuple ID for scroll cursors.

Throws:
  `java.sql.SQLException`

#### getStatementType

    int getStatementType()

getStatementType() returns the statement type for the statement prepared.

#### executeFastPath

    java.util.Vector<IfxObject> executeFastPath(java.lang.String signature,
                                                java.util.Vector<IfxObject> inParams,
                                                boolean fParam)
                                         throws java.sql.SQLException

returns a vector of values resulting from executing a UDR on the server

Throws:
  `java.sql.SQLException`

#### executeFastPath

    void executeFastPath(java.lang.String signature,
                         java.util.Vector<IfxObject> inParams,
                         boolean outParam,
                         boolean fParam)
                  throws java.sql.SQLException

Executing a UDR on the server. Call getFPReturnVector() to get the return value(s).

Throws:
  `java.sql.SQLException`

#### getFPReturnVector

    java.util.Vector<IfxObject> getFPReturnVector()

Return the return values from a fast path call.

#### getFParam

    com.informix.jdbc.IfxFParam getFParam()

Return the fparam data from a fast path call.

#### getTupleCount

    int getTupleCount()

Return the number of tuples in the tuple vector.

#### executeGetDBList

    void executeGetDBList()
                   throws java.sql.SQLException

Gets the list of databases on the server to which we are connected

Throws:
  `java.sql.SQLException`

#### getDBList

    java.util.Vector<java.lang.String> getDBList()

Returns the Vector in which database names are stored.

#### executeOpenDatabase

    void executeOpenDatabase(java.lang.String dbName,
                             int flags)
                      throws java.sql.SQLException

Opens a database.

Throws:
  `java.sql.SQLException`

#### incRefCount

    int incRefCount(byte[] locator)
             throws java.sql.SQLException

Increments refcount of a large object

Throws:
  `java.sql.SQLException`

#### decRefCount

    int decRefCount(byte[] locator)
             throws java.sql.SQLException

Decrements refcount of a large object

Throws:
  `java.sql.SQLException`

#### executeDescribeInput

    IfxResultSetMetaData executeDescribeInput()
                                       throws java.sql.SQLException

Execute DESCRIBE INPUT command

Throws:
  `java.sql.SQLException`

#### executeFPDescribe

    IfxResultSetMetaData executeFPDescribe(java.lang.String signature,
                                           boolean isProc,
                                           java.lang.String procName,
                                           int numargs)
                                    throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getBigSerialInserted

    long getBigSerialInserted()

Retrieve the last bigserial value inserted returned by SQ_INSERTDONE

#### executeRelease

    void executeRelease(int id)
                 throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### handlePrivateServerExchange

    boolean handlePrivateServerExchange()
                                 throws java.sql.SQLException

Throws:
  `java.sql.SQLException`