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 IfxProtocol
public int getStatementType()
IfxProtocol
getStatementType
in interface IfxProtocol
public void clearBatch()
public void clear()
clear
in interface IfxProtocol
public void executeBegin() throws java.sql.SQLException
executeBegin
in interface IfxProtocol
java.sql.SQLException
public void executeCommit() throws java.sql.SQLException
executeCommit
in interface IfxProtocol
java.sql.SQLException
public void executeSavepoint(java.lang.String savepointname, boolean uniqflag) throws java.sql.SQLException
IfxProtocol
executeSavepoint
in interface IfxProtocol
java.sql.SQLException
public void executeReleaseSavepoint(java.lang.String savepointname) throws java.sql.SQLException
IfxProtocol
executeReleaseSavepoint
in interface IfxProtocol
java.sql.SQLException
public void executeRollbackSavepoint(java.lang.String savepointname) throws java.sql.SQLException
IfxProtocol
executeRollbackSavepoint
in interface IfxProtocol
java.sql.SQLException
public void executeRollback() throws java.sql.SQLException
executeRollback
in interface IfxProtocol
java.sql.SQLException
public void executeGetDBList() throws java.sql.SQLException
executeGetDBList
in interface IfxProtocol
java.sql.SQLException
public java.util.Vector<java.lang.String> getDBList()
getDBList
in interface IfxProtocol
public void executeCommand(java.sql.Statement stmt) throws java.sql.SQLException
executeCommand
in interface IfxProtocol
stmt
- Statement objectjava.sql.SQLException
public void executePrepare(java.sql.Statement stmt) throws java.sql.SQLException
executePrepare
in interface IfxProtocol
stmt
- Statement objectjava.sql.SQLException
public void executeStatementQuery(java.sql.Statement stmt) throws java.sql.SQLException
executeStatementQuery
in interface IfxProtocol
stmt
- Statement objectjava.sql.SQLException
public void executeStatementQuery(java.sql.Statement stmt, boolean withHold, boolean withReOptimization) throws java.sql.SQLException
executeStatementQuery
in interface IfxProtocol
stmt
- Statement objectwithHold
- , boolean hold cursor over executionjava.sql.SQLException
public void executeStatementQuery(java.sql.Statement stmt, boolean withHold, boolean withReOptimization, java.sql.ResultSetMetaData outputDesc) throws java.sql.SQLException
IfxProtocol
executeStatementQuery
in interface IfxProtocol
stmt
- Statement objectwithHold
- , boolean hold cursor over executionoutputDesc
- Meta data describing the output host variable
types.java.sql.SQLException
public void executeOpenDatabase(java.lang.String dbName, int flags) throws java.sql.SQLException
executeOpenDatabase
in interface IfxProtocol
java.sql.SQLException
public void executeClose(java.sql.Statement stmt) throws java.sql.SQLException
executeClose
in interface IfxProtocol
stmt
- Statement objectjava.sql.SQLException
public void executeRelease(int id) throws java.sql.SQLException
executeRelease
in interface IfxProtocol
id
- Statement id inegerjava.sql.SQLException
public void executeRelease(java.sql.Statement stmt) throws java.sql.SQLException
executeRelease
in interface IfxProtocol
stmt
- Statement objectjava.sql.SQLException
public void executeCloseDatabase() throws java.sql.SQLException
executeCloseDatabase
in interface IfxProtocol
java.sql.SQLException
public void executeExecute(java.sql.Statement stmt, boolean holdable, boolean withReOptimization) throws java.sql.SQLException
executeExecute
in interface IfxProtocol
stmt
- Statement objectjava.sql.SQLException
public void executeExecute(java.sql.Statement stmt, boolean holdable, boolean withReOptimization, java.sql.ResultSetMetaData outputDesc) throws java.sql.SQLException
IfxProtocol
executeExecute
in interface IfxProtocol
java.sql.SQLException
public void receiveMessage() throws java.sql.SQLException
java.sql.SQLException
public boolean dispatchMsg(int msg) throws java.lang.Exception
java.lang.Exception
protected void flip() throws java.sql.SQLException
java.sql.SQLException
public void sendSQBatchStart() throws java.io.IOException
java.io.IOException
public void sendSQBatchEnd() throws java.io.IOException
java.io.IOException
public long getBigSerialInserted()
getBigSerialInserted
in interface IfxProtocol
public long getSerial8Inserted()
getSerial8Inserted
in interface IfxProtocol
public int getEstimateNumberofRow()
getEstimateNumberofRow
in interface IfxProtocol
public int getSerialInsert()
getSerialInsert
in interface IfxProtocol
public int getNumberOfRowsProcessed()
getNumberOfRowsProcessed
in interface IfxProtocol
public void addException(java.sql.SQLException e)
public java.sql.SQLException getExceptions()
public void chainWarnings(java.sql.SQLWarning cwarn)
chainWarnings
in interface IfxProtocol
cwarn
- the SQLWarning instance to be chained.public void clearExceptions()
clearExceptions
in interface IfxProtocol
public void clearWarnings()
clearWarnings
in interface IfxProtocol
public java.sql.SQLWarning getWarnings()
getWarnings
in interface IfxProtocol
public int getSQLCode()
public void executeEnv(java.util.Properties EnvVars) throws java.sql.SQLException
IfxProtocol
executeEnv
in interface IfxProtocol
java.sql.SQLException
public void executeVersion() throws java.sql.SQLException
IfxProtocol
executeVersion
in interface IfxProtocol
java.sql.SQLException
public java.lang.String getServerVersion()
IfxProtocol
getServerVersion
in interface IfxProtocol
public boolean isResultSet() throws java.sql.SQLException
isResultSet
in interface IfxProtocol
java.sql.SQLException
public int getTupleCount()
getTupleCount
in interface IfxProtocol
public boolean getaRow(int direction, int count, int scrolltype, int isscrollcurs, java.sql.Statement stmt) throws java.sql.SQLException
getaRow
in interface IfxProtocol
direction
- 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.SQLException
public int getTupleSize() throws java.sql.SQLException
getTupleSize
in interface IfxProtocol
java.sql.SQLException
getTuple
public IfxObject getColumnInRow(int colIndex) throws java.sql.SQLException
getColumnInRow
in interface IfxProtocol
colIndex
- index of column in the row, 1 being the first column.java.sql.SQLException
public void loadColumnData(int colIndex, IfxObject val) throws java.sql.SQLException
loadColumnData
in interface IfxProtocol
colIndex
- index of column in the row, 1 being the first column.IfxObject
- to load data into.java.sql.SQLException
public void executeFetchBlob(IfxObject blobDesc) throws java.sql.SQLException
executeFetchBlob
in interface IfxProtocol
blobDesc
- IfxObject that converts data from/to
informix/java valuesjava.sql.SQLException
public 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
IfxProtocol
getTupid
in interface IfxProtocol
java.sql.SQLException
public java.io.InputStream toClobStream(IfxSmBlob obj) throws java.sql.SQLException
java.sql.SQLException
public java.util.Vector<IfxObject> executeFastPath(java.lang.String signature, java.util.Vector<IfxObject> inParams, boolean request_fparam) throws java.sql.SQLException
executeFastPath
in interface IfxProtocol
String
- 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.SQLException
public void executeFastPath(java.lang.String signature, java.util.Vector<IfxObject> inParams, boolean hasOutParameter, boolean request_fparam) throws java.sql.SQLException
IfxProtocol
executeFastPath
in interface IfxProtocol
java.sql.SQLException
public 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.SQLException
public java.util.Vector<IfxObject> getFPReturnVector()
IfxProtocol
getFPReturnVector
in interface IfxProtocol
public com.informix.jdbc.IfxFParam getFParam()
IfxProtocol
getFParam
in interface IfxProtocol
public int executeReadSmBlob(int lofd, byte[] buffer, int nbytes) throws java.sql.SQLException
IfxProtocol
executeReadSmBlob
in interface IfxProtocol
lofd
- Smart blob handle as returned
by the server.nbytes
- no. of bytes to read.java.sql.SQLException
public int executeReadSmBlob(int lofd, byte[] buffer, int nbytes, int offset) throws java.sql.SQLException
IfxProtocol
executeReadSmBlob
in interface IfxProtocol
lofd
- Smart blob handle as returned
by the server.nbytes
- no. of bytes to read.offset
- start offset of datajava.sql.SQLException
public int executeReadSmBlob(int lofd, java.io.FileOutputStream fileFd, int nbytes) throws java.sql.SQLException
IfxProtocol
executeReadSmBlob
in interface IfxProtocol
fileFd
- FileOutputStream to read.nbytes
- no. of bytes to read.java.sql.SQLException
public int executeWriteSmBlob(int loFd, byte[] buffer) throws java.sql.SQLException
IfxProtocol
executeWriteSmBlob
in interface IfxProtocol
loFd
- Smart blob handle as returned
by the server.java.sql.SQLException
public int executeWriteSmBlob(int loFd, byte[] buffer, int offset, int length) throws java.sql.SQLException
executeWriteSmBlob
in interface IfxProtocol
java.sql.SQLException
public int executeWriteSmBlob(int loFd, java.io.InputStream fin, int length) throws java.sql.SQLException
IfxProtocol
executeWriteSmBlob
in interface IfxProtocol
loFd
- Smart blob handle as returned
by the server.fin
- InputStream to write.length
- no. of bytes to read.java.sql.SQLException
public void executeProtocols(byte[] protocols) throws java.sql.SQLException
executeProtocols
in interface IfxProtocol
java.sql.SQLException
public byte[] getProtocols()
getProtocols
in interface IfxProtocol
public int incRefCount(byte[] locator) throws java.sql.SQLException
IfxProtocol
incRefCount
in interface IfxProtocol
java.sql.SQLException
public int decRefCount(byte[] locator) throws java.sql.SQLException
IfxProtocol
decRefCount
in interface IfxProtocol
java.sql.SQLException
protected void setIsReleased(boolean val)
public IfxResultSetMetaData executeDescribeInput() throws java.sql.SQLException
IfxProtocol
executeDescribeInput
in interface IfxProtocol
java.sql.SQLException
public boolean handlePrivateServerExchange() throws java.sql.SQLException
handlePrivateServerExchange
in interface IfxProtocol
java.sql.SQLException
public void handlePAMAuthentication(java.lang.String PAMClientClassName) throws java.sql.SQLException
handlePAMAuthentication
in interface IfxProtocol
java.sql.SQLException
public IfxResultSetMetaData executeFPDescribe(java.lang.String signature, boolean isProc, java.lang.String procName, int numargs) throws java.sql.SQLException
executeFPDescribe
in interface IfxProtocol
java.sql.SQLException
public boolean getNextSGKRow() throws java.sql.SQLException
java.sql.SQLException
public int getNumberOfFetches()
protected int getNumberOfTuplesReceived()
public int getPutErrRowCount()
public void clearPutErrRowCount()