public class IfxSqli extends java.lang.Object implements IfxProtocol
| Modifier and Type | Field and Description |
|---|---|
java.util.ArrayList<java.lang.Integer> |
batchRowStatus |
protected IfxSqliConnect |
conn |
protected static int |
INFX_BUFSIZE |
protected static int |
INFX_MAX_BIGBUFSIZE |
protected static int |
INFX_MAXBUFSIZE |
protected IfxDataInputStream |
is |
protected IfxDataOutputStream |
os |
protected Trace |
protoTrace |
protected com.informix.jdbc.IfxRowColumn |
SGK_rowColumn |
protected boolean |
SQ_CLOSERecvd |
protected SqliDbg |
sqliTrace |
protected Trace |
trace |
| Constructor and Description |
|---|
IfxSqli(IfxSqliConnect conn_arg)
Constructor for the IfxProtocol
|
| Modifier and Type | Method and Description |
|---|---|
void |
addException(java.sql.SQLException e) |
void |
chainWarnings(java.sql.SQLWarning cwarn)
Chain SQLWarning
|
void |
clear()
Clear member values.
|
void |
clearBatch()
Clear members which were set when batch update was in progress
|
void |
clearExceptions()
Clear SQLException chain.
|
void |
clearPutErrRowCount()
clears the number of rows inserted in SQ_PUT batch
|
void |
clearWarnings()
Clear SQLWarning chain.
|
int |
decRefCount(byte[] locator)
Decrements refcount of a large object
|
boolean |
dispatchMsg(int msg) |
void |
executeBegin()
The public method for sending the SQ_BEGIN to start a transaction
|
void |
executeClose(java.sql.Statement stmt)
public method for Close in the ResultSet object.
|
void |
executeCloseDatabase()
Public method for closing a database.
|
void |
executeCommand(java.sql.Statement stmt)
The public method for the sending of the COMMAND packet to the server and receiving the returned information from the server.
|
void |
executeCommit()
The public method for sending the SQ_CMMTWORK to commit the transaction
|
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 withReOptimization)
Public method for the support of execute() in both PreparedStatement and Statement
|
void |
executeExecute(java.sql.Statement stmt,
boolean holdable,
boolean withReOptimization,
java.sql.ResultSetMetaData outputDesc)
Exceute a SQL statement on the server.
|
void |
executeFastPath(java.lang.String signature,
java.sql.ResultSetMetaData pmd,
java.util.Vector<IfxObject> inParams,
boolean hasOutParameter,
boolean request_fparam)
executeFastPath is the public method which provides access to the fastpath facility.
|
java.util.Vector<IfxObject> |
executeFastPath(java.lang.String signature,
java.util.Vector<IfxObject> inParams,
boolean request_fparam)
executeFastPath is the public method which provides access to the fastpath facility.
|
void |
executeFastPath(java.lang.String signature,
java.util.Vector<IfxObject> inParams,
boolean hasOutParameter,
boolean request_fparam)
Executing a UDR on the server.
|
void |
executeFetchBlob(IfxObject blobDesc)
This function will be called from IfxBlob.toAscii() and IfxBlob.toBinary() function in IfxBlob.java file
|
IfxResultSetMetaData |
executeFPDescribe(java.lang.String signature,
boolean isProc,
java.lang.String procName,
int numargs) |
void |
executeGetDBList()
The public method for sending SQ_DBLIST to the server.
|
void |
executeOpenDatabase(java.lang.String dbName,
int flags)
Public method for opening a database.
|
void |
executePrepare(java.sql.Statement stmt)
The public method for sending the PREPARE packet to the server and receiving the return values from 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)
public OVERLOADED method for release in the Statement object.
|
void |
executeRelease(java.sql.Statement stmt)
public method for Close in the Statement object.
|
void |
executeReleaseSavepoint(java.lang.String savepointname)
Release Savepoint on the server
|
void |
executeRollback()
The public method for sending SQ_RBWORK to the server.
|
void |
executeRollbackSavepoint(java.lang.String savepointname)
Set Savepoint on the server
|
void |
executeSavepoint(java.lang.String savepointname,
boolean uniqflag)
Set Savepoint on the server
|
void |
executeScrollFetch(int scrolltype,
int index,
java.sql.Statement stmt,
int fetchBufferSize)
executeScrollFetch() calls sendScrollFetch() to seen the Scroll cursor SQ_SFETCH message to the server.
|
void |
executeStatementQuery(java.sql.Statement stmt)
public method to do the executeQuery for Statement objects and PreparedStatements
|
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 outputDesc)
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 fin,
int length)
Write into the Smart blob
|
protected void |
flip()
Notify OutputStream that messages should be sent to the server.
|
boolean |
getaRow(int direction,
int count,
int scrolltype,
int isscrollcurs,
java.sql.Statement stmt)
get the requested row.
|
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()
This method returns the list of databases returned by the server in a Vector.
|
int |
getEstimateNumberofRow()
Estimated number of rows sent in IfxMessageTypes.SQ_COST message.
|
java.sql.SQLException |
getExceptions() |
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 member ResultSetMetaData object.
|
boolean |
getNextSGKRow()
SGK resultSets are forward only and read only all the tuples are sent immediately after execution (by the server)
|
int |
getNumberOfFetches()
get number of fetches (SQ_NFETCH or SQ_FETCH for this (ResultSet) method is public for testing, it is not intended to be documented
|
int |
getNumberOfRowsProcessed()
Number of rows processed sent in SQ_DONE message.
|
protected int |
getNumberOfTuplesReceived() |
byte[] |
getProtocols() |
int |
getPutErrRowCount() |
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 |
getSQLCode()
Retrieve the error code from SQ_ERR
|
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 sent by the server.
|
java.sql.SQLWarning |
getWarnings()
Get SQLWarnings chain.
|
void |
handlePAMAuthentication(java.lang.String PAMClientClassName) |
boolean |
handlePrivateServerExchange() |
int |
incRefCount(byte[] locator)
Increments refcount of a large object
|
boolean |
isResultSet()
isResultSet() returns true if the current statement can return resultset.
|
void |
loadColumnData(int colIndex,
IfxObject val)
Load data value of a column in the current row into the given IfxObject.
|
void |
receiveMessage()
receiveMessage Generic message receiving method from the server
|
void |
sendSQBatchEnd()
Sends SQBATCHEND message to output stream for ANSI DB when execute batch is done writes relevant messages to trace file.
|
void |
sendSQBatchStart()
Sends SQBATCHSTART message to output stream for ANSI DB when execute batch is in progress writes relevant messages to trace file.
|
protected void |
setIsReleased(boolean val) |
java.io.InputStream |
toClobStream(IfxSmBlob obj) |
protected IfxSqliConnect conn
protected Trace trace
protected Trace protoTrace
protected SqliDbg sqliTrace
protected static final int INFX_BUFSIZE
protected static final int INFX_MAXBUFSIZE
protected static final int INFX_MAX_BIGBUFSIZE
protected com.informix.jdbc.IfxRowColumn SGK_rowColumn
protected IfxDataOutputStream os
protected IfxDataInputStream is
protected boolean SQ_CLOSERecvd
public java.util.ArrayList<java.lang.Integer> batchRowStatus
public IfxSqli(IfxSqliConnect conn_arg)
conn_arg - current connectionpublic java.sql.ResultSetMetaData getMetaData()
getMetaData in interface IfxProtocolpublic int getStatementType()
IfxProtocolgetStatementType in interface IfxProtocolpublic void clearBatch()
public void clear()
clear in interface IfxProtocolpublic void executeBegin()
throws java.sql.SQLException
executeBegin in interface IfxProtocoljava.sql.SQLExceptionpublic void executeCommit()
throws java.sql.SQLException
executeCommit in interface IfxProtocoljava.sql.SQLExceptionpublic void executeSavepoint(java.lang.String savepointname,
boolean uniqflag)
throws java.sql.SQLException
IfxProtocolexecuteSavepoint in interface IfxProtocoljava.sql.SQLExceptionpublic void executeReleaseSavepoint(java.lang.String savepointname)
throws java.sql.SQLException
IfxProtocolexecuteReleaseSavepoint in interface IfxProtocoljava.sql.SQLExceptionpublic void executeRollbackSavepoint(java.lang.String savepointname)
throws java.sql.SQLException
IfxProtocolexecuteRollbackSavepoint in interface IfxProtocoljava.sql.SQLExceptionpublic void executeRollback()
throws java.sql.SQLException
executeRollback in interface IfxProtocoljava.sql.SQLExceptionpublic void executeGetDBList()
throws java.sql.SQLException
executeGetDBList in interface IfxProtocoljava.sql.SQLExceptionpublic java.util.Vector<java.lang.String> getDBList()
getDBList in interface IfxProtocolpublic void executeCommand(java.sql.Statement stmt)
throws java.sql.SQLException
executeCommand in interface IfxProtocolstmt - Statement objectjava.sql.SQLExceptionpublic void executePrepare(java.sql.Statement stmt)
throws java.sql.SQLException
executePrepare in interface IfxProtocolstmt - Statement objectjava.sql.SQLExceptionpublic void executeStatementQuery(java.sql.Statement stmt)
throws java.sql.SQLException
executeStatementQuery in interface IfxProtocolstmt - Statement objectjava.sql.SQLExceptionpublic void executeStatementQuery(java.sql.Statement stmt,
boolean withHold,
boolean withReOptimization)
throws java.sql.SQLException
executeStatementQuery in interface IfxProtocolstmt - Statement objectwithHold - , boolean hold cursor over executionjava.sql.SQLExceptionpublic void executeStatementQuery(java.sql.Statement stmt,
boolean withHold,
boolean withReOptimization,
java.sql.ResultSetMetaData outputDesc)
throws java.sql.SQLException
IfxProtocolexecuteStatementQuery in interface IfxProtocolstmt - Statement objectwithHold - , boolean hold cursor over executionoutputDesc - Meta data describing the output host variable
types.java.sql.SQLExceptionpublic void executeOpenDatabase(java.lang.String dbName,
int flags)
throws java.sql.SQLException
executeOpenDatabase in interface IfxProtocoljava.sql.SQLExceptionpublic void executeClose(java.sql.Statement stmt)
throws java.sql.SQLException
executeClose in interface IfxProtocolstmt - Statement objectjava.sql.SQLExceptionpublic void executeRelease(int id)
throws java.sql.SQLException
executeRelease in interface IfxProtocolid - Statement id inegerjava.sql.SQLExceptionpublic void executeRelease(java.sql.Statement stmt)
throws java.sql.SQLException
executeRelease in interface IfxProtocolstmt - Statement objectjava.sql.SQLExceptionpublic void executeCloseDatabase()
throws java.sql.SQLException
executeCloseDatabase in interface IfxProtocoljava.sql.SQLExceptionpublic void executeExecute(java.sql.Statement stmt,
boolean holdable,
boolean withReOptimization)
throws java.sql.SQLException
executeExecute in interface IfxProtocolstmt - Statement objectjava.sql.SQLExceptionpublic void executeExecute(java.sql.Statement stmt,
boolean holdable,
boolean withReOptimization,
java.sql.ResultSetMetaData outputDesc)
throws java.sql.SQLException
IfxProtocolexecuteExecute in interface IfxProtocoljava.sql.SQLExceptionpublic void receiveMessage()
throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean dispatchMsg(int msg)
throws java.lang.Exception
java.lang.Exceptionprotected void flip()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void sendSQBatchStart()
throws java.io.IOException
java.io.IOExceptionpublic void sendSQBatchEnd()
throws java.io.IOException
java.io.IOExceptionpublic long getBigSerialInserted()
getBigSerialInserted in interface IfxProtocolpublic long getSerial8Inserted()
getSerial8Inserted in interface IfxProtocolpublic int getEstimateNumberofRow()
getEstimateNumberofRow in interface IfxProtocolpublic int getSerialInsert()
getSerialInsert in interface IfxProtocolpublic int getNumberOfRowsProcessed()
getNumberOfRowsProcessed in interface IfxProtocolpublic void addException(java.sql.SQLException e)
public java.sql.SQLException getExceptions()
public void chainWarnings(java.sql.SQLWarning cwarn)
chainWarnings in interface IfxProtocolcwarn - the SQLWarning instance to be chained.public void clearExceptions()
clearExceptions in interface IfxProtocolpublic void clearWarnings()
clearWarnings in interface IfxProtocolpublic java.sql.SQLWarning getWarnings()
getWarnings in interface IfxProtocolpublic int getSQLCode()
public void executeEnv(java.util.Properties EnvVars)
throws java.sql.SQLException
IfxProtocolexecuteEnv in interface IfxProtocoljava.sql.SQLExceptionpublic void executeVersion()
throws java.sql.SQLException
IfxProtocolexecuteVersion in interface IfxProtocoljava.sql.SQLExceptionpublic java.lang.String getServerVersion()
IfxProtocolgetServerVersion in interface IfxProtocolpublic boolean isResultSet()
throws java.sql.SQLException
isResultSet in interface IfxProtocoljava.sql.SQLExceptionpublic int getTupleCount()
getTupleCount in interface IfxProtocolpublic boolean getaRow(int direction,
int count,
int scrolltype,
int isscrollcurs,
java.sql.Statement stmt)
throws java.sql.SQLException
getaRow in interface IfxProtocoldirection - Valid values are FETCH_FORWARD/FETCH_REVERSE.count - number of rows to move forward/backward. or desired row (DIR_ABSL) note: if FETCH_REVERSE then count==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().java.sql.SQLExceptionpublic int getTupleSize()
throws java.sql.SQLException
getTupleSize in interface IfxProtocoljava.sql.SQLExceptiongetTuplepublic IfxObject getColumnInRow(int colIndex) throws java.sql.SQLException
getColumnInRow in interface IfxProtocolcolIndex - index of column in the row, 1 being the first column.java.sql.SQLExceptionpublic void loadColumnData(int colIndex,
IfxObject val)
throws java.sql.SQLException
loadColumnData in interface IfxProtocolcolIndex - index of column in the row, 1 being the first column.IfxObject - to load data into.java.sql.SQLExceptionpublic void executeFetchBlob(IfxObject blobDesc) throws java.sql.SQLException
executeFetchBlob in interface IfxProtocolblobDesc - IfxObject that converts data from/to
informix/java valuesjava.sql.SQLExceptionpublic void executeScrollFetch(int scrolltype,
int index,
java.sql.Statement stmt,
int fetchBufferSize)
throws java.sql.SQLException
scrolltype - Type of scroll behavior (absolute, relative etc).index - Index into row.fetchBufferSize - , 0 or user requested sizejava.sql.SQLException - if database access error occurs.public int getTupid()
throws java.sql.SQLException
IfxProtocolgetTupid in interface IfxProtocoljava.sql.SQLExceptionpublic java.io.InputStream toClobStream(IfxSmBlob obj) throws java.sql.SQLException
java.sql.SQLExceptionpublic java.util.Vector<IfxObject> executeFastPath(java.lang.String signature, java.util.Vector<IfxObject> inParams, boolean request_fparam) throws java.sql.SQLException
executeFastPath in interface IfxProtocolString - signature - a string representing the signature of the server method to be calledVector - inParams - a vector of IfxXXX objects, each containing a value to be sent to the serverjava.sql.SQLExceptionpublic void executeFastPath(java.lang.String signature,
java.util.Vector<IfxObject> inParams,
boolean hasOutParameter,
boolean request_fparam)
throws java.sql.SQLException
IfxProtocolexecuteFastPath in interface IfxProtocoljava.sql.SQLExceptionpublic void executeFastPath(java.lang.String signature,
java.sql.ResultSetMetaData pmd,
java.util.Vector<IfxObject> inParams,
boolean hasOutParameter,
boolean request_fparam)
throws java.sql.SQLException
String - signature - a string representing the signature of the server method to be calledResultSetMetaData - pmd - metadata for parametersVector - inParams - a vector of IfxXXX objects, each containing a value to be sent to the serverboolean - outParam - is there an OUT parameter in this routine?java.sql.SQLExceptionpublic java.util.Vector<IfxObject> getFPReturnVector()
IfxProtocolgetFPReturnVector in interface IfxProtocolpublic com.informix.jdbc.IfxFParam getFParam()
IfxProtocolgetFParam in interface IfxProtocolpublic int executeReadSmBlob(int lofd,
byte[] buffer,
int nbytes)
throws java.sql.SQLException
IfxProtocolexecuteReadSmBlob in interface IfxProtocollofd - Smart blob handle as returned
by the server.nbytes - no. of bytes to read.java.sql.SQLExceptionpublic int executeReadSmBlob(int lofd,
byte[] buffer,
int nbytes,
int offset)
throws java.sql.SQLException
IfxProtocolexecuteReadSmBlob in interface IfxProtocollofd - Smart blob handle as returned
by the server.nbytes - no. of bytes to read.offset - start offset of datajava.sql.SQLExceptionpublic int executeReadSmBlob(int lofd,
java.io.FileOutputStream fileFd,
int nbytes)
throws java.sql.SQLException
IfxProtocolexecuteReadSmBlob in interface IfxProtocolfileFd - FileOutputStream to read.nbytes - no. of bytes to read.java.sql.SQLExceptionpublic int executeWriteSmBlob(int loFd,
byte[] buffer)
throws java.sql.SQLException
IfxProtocolexecuteWriteSmBlob in interface IfxProtocolloFd - Smart blob handle as returned
by the server.java.sql.SQLExceptionpublic int executeWriteSmBlob(int loFd,
byte[] buffer,
int offset,
int length)
throws java.sql.SQLException
executeWriteSmBlob in interface IfxProtocoljava.sql.SQLExceptionpublic int executeWriteSmBlob(int loFd,
java.io.InputStream fin,
int length)
throws java.sql.SQLException
IfxProtocolexecuteWriteSmBlob in interface IfxProtocolloFd - Smart blob handle as returned
by the server.fin - InputStream to write.length - no. of bytes to read.java.sql.SQLExceptionpublic void executeProtocols(byte[] protocols)
throws java.sql.SQLException
executeProtocols in interface IfxProtocoljava.sql.SQLExceptionpublic byte[] getProtocols()
getProtocols in interface IfxProtocolpublic int incRefCount(byte[] locator)
throws java.sql.SQLException
IfxProtocolincRefCount in interface IfxProtocoljava.sql.SQLExceptionpublic int decRefCount(byte[] locator)
throws java.sql.SQLException
IfxProtocoldecRefCount in interface IfxProtocoljava.sql.SQLExceptionprotected void setIsReleased(boolean val)
public IfxResultSetMetaData executeDescribeInput() throws java.sql.SQLException
IfxProtocolexecuteDescribeInput in interface IfxProtocoljava.sql.SQLExceptionpublic boolean handlePrivateServerExchange()
throws java.sql.SQLException
handlePrivateServerExchange in interface IfxProtocoljava.sql.SQLExceptionpublic void handlePAMAuthentication(java.lang.String PAMClientClassName)
throws java.sql.SQLException
handlePAMAuthentication in interface IfxProtocoljava.sql.SQLExceptionpublic IfxResultSetMetaData executeFPDescribe(java.lang.String signature, boolean isProc, java.lang.String procName, int numargs) throws java.sql.SQLException
executeFPDescribe in interface IfxProtocoljava.sql.SQLExceptionpublic boolean getNextSGKRow()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getNumberOfFetches()
protected int getNumberOfTuplesReceived()
public int getPutErrRowCount()
public void clearPutErrRowCount()