Package org.apache.derby.impl.drda
Class DRDAStatement.DrdaParamState
- java.lang.Object
-
- org.apache.derby.impl.drda.DRDAStatement.DrdaParamState
-
- Enclosing class:
- DRDAStatement
private static class DRDAStatement.DrdaParamState extends java.lang.ObjectThis class is used to keep track of the statement's parameters as they are received from the client. It uses arrays to track the DRDA type, the length in bytes and the externalness of each parameter. Arrays of int/byte are used rather than ArrayLists of Integer/Byte in order to re-use the same storage each time the statement is executed.
-
-
Field Summary
Fields Modifier and Type Field Description private int[]extLst_private intextLstEnd_private int[]lenLst_private EXTDTAReaderInputStreamstreamedParameterprivate byte[]typeLst_private inttypeLstEnd_
-
Constructor Summary
Constructors Modifier Constructor Description privateDrdaParamState()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDrdaParam(byte t, int s)addDrdaParamadds a new parameter with its DRDA type and byte length.protected voidaddExtPos(int p)addExtPosmarks parameter i as external.protected voidclear(boolean trim)clearresets the arrays so that new parameters will be added at the beginning.protected voiddrainStreamedParameter()Read the rest of the streamed parameter if not consumed by the executing statement.protected intgetDrdaLen(int i)getDrdaLenreturns the length in bytes of the ith parameter.protected intgetDrdaParamCount()getDrdaParamCountreturn the number of parameters added so far (since last clear).protected bytegetDrdaType(int i)getDrdaTypereturns a byte that represents the DRDA type of the ith parameter.protected intgetExtPos(int i)getExtPosreturns the actual parameter position of the ith external parameter.protected intgetExtPosCount()getExtPosCountreturns the number of parameters marked as external so far (since last clear).private static java.lang.ObjectgrowArray(java.lang.Object array)voidsetStreamedParameter(EXTDTAReaderInputStream eis)
-
-
-
Field Detail
-
streamedParameter
private EXTDTAReaderInputStream streamedParameter
-
typeLstEnd_
private int typeLstEnd_
-
typeLst_
private byte[] typeLst_
-
lenLst_
private int[] lenLst_
-
extLstEnd_
private int extLstEnd_
-
extLst_
private int[] extLst_
-
-
Method Detail
-
growArray
private static java.lang.Object growArray(java.lang.Object array)
-
clear
protected void clear(boolean trim)
clearresets the arrays so that new parameters will be added at the beginning. No initialization or releasing of storage takes place unless the trim argument is true.- Parameters:
trim- - if true; release excess storage
-
addDrdaParam
protected void addDrdaParam(byte t, int s)addDrdaParamadds a new parameter with its DRDA type and byte length. The arrays are automatically grown if needed.- Parameters:
t- abytevalue, the DRDA type of the parameter being addeds- anintvalue, the length in bytes of the parameter being added
-
getDrdaParamCount
protected int getDrdaParamCount()
getDrdaParamCountreturn the number of parameters added so far (since last clear).- Returns:
- an
intvalue, the number of parameters
-
getDrdaType
protected byte getDrdaType(int i)
getDrdaTypereturns a byte that represents the DRDA type of the ith parameter.- Parameters:
i- anintvalue, a parameter position (zero-based)- Returns:
- a
bytevalue, the DRDA type
-
getDrdaLen
protected int getDrdaLen(int i)
getDrdaLenreturns the length in bytes of the ith parameter.- Parameters:
i- anintvalue, a parameter position (zero-based)- Returns:
- an
intvalue
-
addExtPos
protected void addExtPos(int p)
addExtPosmarks parameter i as external. The array is grown as needed.- Parameters:
p- anintvalue, a parameter position (zero-based)
-
getExtPosCount
protected int getExtPosCount()
getExtPosCountreturns the number of parameters marked as external so far (since last clear).- Returns:
- an
intvalue, the number of external parameters.
-
getExtPos
protected int getExtPos(int i)
getExtPosreturns the actual parameter position of the ith external parameter.- Parameters:
i- anintvalue, index into the list of external parameters, zero-based- Returns:
- an
intvalue, the parameter position of the ith external parameter (zero-based)
-
drainStreamedParameter
protected void drainStreamedParameter() throws java.io.IOExceptionRead the rest of the streamed parameter if not consumed by the executing statement. DERBY-3085- Throws:
java.io.IOException
-
setStreamedParameter
public void setStreamedParameter(EXTDTAReaderInputStream eis)
-
-