|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.drda.DRDAStatement
class DRDAStatement
DRDAStatement stores information about the statement being executed
Nested Class Summary | |
---|---|
private static class |
DRDAStatement.DrdaParamState
This class is used to keep track of the statement's parameters as they are received from the client. |
Field Summary | |
---|---|
protected int |
blksize
|
protected int |
byteOrder
|
protected int |
ccsidDBC
|
protected java.lang.String |
ccsidDBCEncoding
|
protected int |
ccsidMBC
|
protected java.lang.String |
ccsidMBCEncoding
|
protected int |
ccsidSBC
|
protected java.lang.String |
ccsidSBCEncoding
|
protected int |
concurType
|
private DRDAResultSet |
currentDrdaRs
|
protected java.lang.String |
cursorName
|
protected Database |
database
|
private DRDAStatement.DrdaParamState |
drdaParamState_
|
(package private) boolean |
explicitlyPrepared
|
protected boolean |
isCall
|
protected int |
isolationLevel
|
protected int |
maxblkext
|
protected int |
maxrslcnt
|
protected int |
nbrrow
|
(package private) boolean |
needsToSendParamData
|
protected static int |
NOT_OUTPUT_PARAM
|
private int |
numResultSets
|
protected int |
outovropt
|
protected boolean |
outputExpected
|
private int[] |
outputPrecision
|
private int[] |
outputScale
|
private int[] |
outputTypes
|
protected ConsistencyToken |
pkgcnstkn
|
protected java.lang.String |
pkgid
|
private Pkgnamcsn |
pkgnamcsn
|
protected int |
pkgsn
|
protected java.lang.String |
procName
|
protected java.sql.PreparedStatement |
ps
|
private int |
qryprctyp
|
protected boolean |
qryrfrtbl
|
protected int |
qryrowset
|
private java.util.ArrayList |
resultSetKeyList
|
private java.util.Hashtable |
resultSetTable
|
protected long |
rowCount
|
protected byte[] |
rslsetflg
|
protected int |
scrollType
|
private java.sql.Statement |
stmt
|
protected java.sql.ParameterMetaData |
stmtPmeta
|
protected java.lang.String |
typDefNam
|
(package private) int |
withHoldCursor
|
Constructor Summary | |
---|---|
DRDAStatement(Database database)
DRDAStatement constructor |
Method Summary | |
---|---|
protected void |
addDrdaParam(byte t,
int l)
Add another parameter to this statement. |
protected void |
addExtDtaObject(java.lang.Object o,
int jdbcIndex)
Add extDtaObject |
protected void |
addExtPosition(int pos)
Mark the pos'th parameter as external |
protected ConsistencyToken |
addResultSet(java.sql.ResultSet value,
int holdValue)
Add a new resultSet to this statement. |
protected ConsistencyToken |
calculateResultSetPkgcnstkn(int rsNum)
For a single result set, just echo the consistency token that the client sent us. |
protected void |
clearDrdaParams()
Clears the parameter state (type, length and ext information) stored in this statement, but does not release any storage. |
protected void |
clearExtDtaObjects()
Clear externalized lob objects in current result set |
protected void |
close()
This method closes the JDBC objects and frees up all references held by this object. |
protected void |
CLSQRY()
Explicitly close the result set by CLSQRY needed to check for double close. |
protected boolean |
execute()
Executes the prepared statement and populates the resultSetTable. |
protected java.sql.PreparedStatement |
explicitPrepare(java.lang.String sqlStmt)
|
protected void |
finishParams()
clear out type data for parameters. |
protected int |
getBlksize()
|
protected int |
getConcurType()
|
protected DRDAResultSet |
getCurrentDrdaResultSet()
Gets the current DRDA ResultSet |
protected int |
getDrdaParamCount()
Get the number of parameters, internal and external, that has been added to this statement. |
private DRDAResultSet |
getDrdaResultSet(ConsistencyToken consistToken)
|
private DRDAResultSet |
getDrdaResultSet(int rsNum)
|
protected java.util.ArrayList |
getExtDtaObjects()
Get the extData Objects |
protected int |
getExtPosition(int i)
Get the parameter position of the i'th external parameter |
protected int |
getExtPositionCount()
Get the number of external parameters in this statement. |
private boolean |
getMoreResults(int current)
get more results using reflection. |
protected int |
getNumResultSets()
|
protected int |
getNumRsCols()
get the number of result set columns for the current resultSet |
protected int[] |
getOutovr_drdaType()
|
protected static int |
getOutputParameterTypeFromClassName(java.lang.String objectName)
Given an object class name get the paramameter type if the parameter mode is unknown. |
(package private) int |
getOutputParamPrecision(int paramNum)
get precision for output parameter. |
(package private) int |
getOutputParamScale(int paramNum)
get scale for output parameter. |
(package private) int |
getOutputParamType(int paramNum)
get type for output parameter. |
protected int |
getParamDRDAType(int index)
get parameter DRDAType |
protected java.sql.ParameterMetaData |
getParameterMetaData()
Retrieve the ParameterMetaData for the prepared statement. |
protected int |
getParamLen(int index)
returns drda length of parameter as sent by client. |
protected int |
getParamPrecision(int index)
get parameter precision or DB2 max (31) |
protected int |
getParamScale(int index)
get parameter scale or DB2 max (31) |
protected Pkgnamcsn |
getPkgnamcsn()
Get pkgnamcsn |
protected java.sql.PreparedStatement |
getPreparedStatement()
Get prepared statement |
protected int |
getQryprctyp()
|
protected long |
getQryrownbr()
|
protected int |
getQryrowset()
|
protected boolean |
getQryrtndta()
|
protected int |
getQryscrorn()
|
protected java.sql.ResultSet |
getResultSet()
Get result set |
java.lang.String |
getResultSetCursorName(int rsNum)
|
protected ConsistencyToken |
getResultSetPkgcnstkn(int rsNum)
|
protected int |
getRsDRDAType(int index)
get resultset/out parameter DRDAType |
protected int[] |
getRsDRDATypes()
|
protected int |
getRsLen(int index)
get resultset/out parameter DRDALen |
protected int |
getRsPrecision(int index)
get resultset /out paramter precision |
protected int |
getRsScale(int index)
get resultset /out paramter scale |
protected int |
getScrollType()
|
byte[] |
getSplitQRYDTA()
|
private java.lang.String |
getSQLText()
Use reflection to retrieve SQL Text for EmbedPreparedStatement or BrokeredPreparedStatement. |
protected java.sql.Statement |
getStatement()
Get the statement |
private int |
getStaticPackageIsolation(java.lang.String pkgid)
get the isolation level for a static package. |
protected boolean |
hasdata()
|
protected boolean |
hasOutputParams()
|
protected void |
initialize()
This method is used to initialize the default statement of the database for re-use. |
private boolean |
isCallableSQL(java.lang.String sql)
|
protected boolean |
isCallableStatement()
|
private boolean |
isDynamicPkgid(java.lang.String pkgid)
|
protected boolean |
isExtDtaValueNullable(int index)
|
(package private) boolean |
isOutputParam(int paramNum)
is parameter an ouput parameter |
(package private) boolean |
isRSCloseImplicit(boolean lmtblkprcOK)
Method to decide whether the ResultSet should be closed implicitly based on the QRYCLSIMP value sent from the client. |
protected boolean |
isScrollable()
is this a scrollable cursor? |
private void |
parsePkgidToFindHoldability()
|
protected java.sql.PreparedStatement |
prepare(java.lang.String sqlStmt)
Create a prepared statement |
void |
registerAllOutParams()
|
void |
registerOutParam(int paramNum)
|
protected void |
reset()
This method resets the state of this DRDAStatement object so that it can be re-used. |
protected void |
rsClose()
Close the current resultSet |
protected boolean |
rsIsClosed()
is Statement closed |
protected void |
rsSuspend()
Set state to SUSPENDED (result set is opened) |
protected void |
setConcurType(int scrollType)
|
protected void |
setCurrentDrdaResultSet(int rsNum)
Set currentDrdaResultSet |
protected void |
setCurrentDrdaResultSet(Pkgnamcsn pkgnamcsn)
Set currentDrdaResultSet |
protected void |
setDatabase(Database database)
Set database |
protected void |
setExtDtaObjects(java.util.ArrayList a)
Set the extData Objects |
protected void |
setHasdata(boolean hasdata)
|
protected void |
setOPNQRYOptions(int blksize,
int qryblkctl,
int maxblkext,
int outovropt,
int qryrowset,
int qryclsimpl)
Set query options sent on OPNQRY and pass options down to the current DRDAResultSet object. |
protected void |
setOutovr_drdaType(int[] outovr_drdaType)
|
protected void |
setPkgnamcsn(Pkgnamcsn pkgnamcsn)
Set the pkgid sec num for this statement and the consistency token that will be used for the first resultSet. |
protected void |
setQryprctyp(int qryprctyp)
|
protected void |
setQryrownbr(long qryrownbr)
|
protected void |
setQryrtndta(boolean qryrtndta)
|
protected void |
setQryscrorn(int qryscrorn)
|
protected void |
setQueryOptions(int blksize,
boolean qryrelscr,
long qryrownbr,
boolean qryfrtbl,
int nbrrow,
int maxblkext,
int qryscrorn,
boolean qryrowsns,
boolean qryblkrst,
boolean qryrtndta,
int qryrowset,
int rtnextdta)
|
protected void |
setRsDefaultOptions(DRDAResultSet drs)
Set resultSet defaults to match the statement defaults sent on EXCSQLSTT This might be overridden on OPNQRY or CNTQRY |
protected void |
setRsDRDAType(int index,
int type)
set result DRDAType |
protected void |
setRsPrecision(int index,
int precision)
set resultset/out parameter precision |
protected void |
setRsScale(int index,
int scale)
set resultset/out parameter scale |
protected void |
setScrollType(int scrollType)
|
void |
setSplitQRYDTA(byte[] data)
|
protected void |
setStatement(java.sql.Connection conn)
Set statement |
protected void |
setStreamedParameter(EXTDTAReaderInputStream eis)
|
protected void |
setTypDefValues()
set TypDef values |
private void |
setupCallableStatementParams(java.sql.CallableStatement cs)
|
protected java.lang.String |
toDebugString(java.lang.String indent)
|
protected boolean |
wasExplicitlyClosed()
|
protected boolean |
wasExplicitlyPrepared()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String typDefNam
protected int byteOrder
protected int ccsidSBC
protected int ccsidDBC
protected int ccsidMBC
protected java.lang.String ccsidSBCEncoding
protected java.lang.String ccsidDBCEncoding
protected java.lang.String ccsidMBCEncoding
protected Database database
private Pkgnamcsn pkgnamcsn
protected ConsistencyToken pkgcnstkn
protected java.lang.String pkgid
protected int pkgsn
int withHoldCursor
protected int isolationLevel
protected java.lang.String cursorName
protected int scrollType
protected int concurType
protected long rowCount
protected byte[] rslsetflg
protected int maxrslcnt
protected java.sql.PreparedStatement ps
protected java.sql.ParameterMetaData stmtPmeta
protected boolean isCall
protected java.lang.String procName
private int[] outputTypes
private int[] outputPrecision
private int[] outputScale
protected static int NOT_OUTPUT_PARAM
protected boolean outputExpected
private java.sql.Statement stmt
private DRDAResultSet currentDrdaRs
private java.util.Hashtable resultSetTable
private java.util.ArrayList resultSetKeyList
private int numResultSets
private DRDAStatement.DrdaParamState drdaParamState_
protected int nbrrow
protected int qryrowset
protected int blksize
protected int maxblkext
protected int outovropt
protected boolean qryrfrtbl
private int qryprctyp
boolean needsToSendParamData
boolean explicitlyPrepared
Constructor Detail |
---|
DRDAStatement(Database database)
database
- Method Detail |
---|
protected void setTypDefValues()
protected void setDatabase(Database database)
database
- protected void setStatement(java.sql.Connection conn) throws java.sql.SQLException
conn
- Connection
java.sql.SQLException
protected java.sql.Statement getStatement() throws java.sql.SQLException
java.sql.SQLException
protected void setRsDefaultOptions(DRDAResultSet drs)
protected java.util.ArrayList getExtDtaObjects()
protected void setExtDtaObjects(java.util.ArrayList a)
public void setSplitQRYDTA(byte[] data)
public byte[] getSplitQRYDTA()
protected void addExtDtaObject(java.lang.Object o, int jdbcIndex)
o
- - object to addjdbcIndex
- - jdbc index for parameterprotected void clearExtDtaObjects()
protected boolean isExtDtaValueNullable(int index)
protected void setOPNQRYOptions(int blksize, int qryblkctl, int maxblkext, int outovropt, int qryrowset, int qryclsimpl)
DRDAResultSet
object.
blksize
- QRYBLKSZ (Query Block Size)qryblkctl
- QRYPRCTYP (Query Protocol Type)maxblkext
- MAXBLKEXT (Maximum Number of Extra Blocks)outovropt
- OUTOVROPT (Output Override Option)qryrowset
- QRYROWSET (Query Rowset Size)qryclsimpl
- QRYCLSIMP (Query Close Implicit)DRDAResultSet.setOPNQRYOptions(int, int, int, int, int, int)
protected void setQueryOptions(int blksize, boolean qryrelscr, long qryrownbr, boolean qryfrtbl, int nbrrow, int maxblkext, int qryscrorn, boolean qryrowsns, boolean qryblkrst, boolean qryrtndta, int qryrowset, int rtnextdta)
protected void setQryprctyp(int qryprctyp)
protected int getQryprctyp() throws java.sql.SQLException
java.sql.SQLException
protected void setQryrownbr(long qryrownbr)
protected long getQryrownbr()
protected int getQryrowset()
protected int getBlksize()
protected void setQryrtndta(boolean qryrtndta)
protected boolean getQryrtndta()
protected void setQryscrorn(int qryscrorn)
protected int getQryscrorn()
protected void setScrollType(int scrollType)
protected int getScrollType()
protected boolean isScrollable()
protected void setConcurType(int scrollType)
protected int getConcurType()
protected void setOutovr_drdaType(int[] outovr_drdaType)
protected int[] getOutovr_drdaType()
protected boolean hasdata()
protected void setHasdata(boolean hasdata)
protected void initialize()
protected java.sql.PreparedStatement explicitPrepare(java.lang.String sqlStmt) throws java.sql.SQLException
java.sql.SQLException
protected boolean wasExplicitlyPrepared()
protected java.sql.PreparedStatement prepare(java.lang.String sqlStmt) throws java.sql.SQLException
sqlStmt
- - SQL statement
java.sql.SQLException
protected java.sql.PreparedStatement getPreparedStatement() throws java.sql.SQLException
java.sql.SQLException
protected boolean execute() throws java.sql.SQLException
java.sql.SQLException
protected void finishParams()
protected void setPkgnamcsn(Pkgnamcsn pkgnamcsn)
pkgnamcsn
- package id section number and token from the clientprivate int getStaticPackageIsolation(java.lang.String pkgid)
pkgid
- - Package identifier string (e.g. SYSSTAT)
protected Pkgnamcsn getPkgnamcsn()
protected java.sql.ResultSet getResultSet()
protected DRDAResultSet getCurrentDrdaResultSet()
protected void setCurrentDrdaResultSet(int rsNum)
rsNum
- The result set number starting with 0protected void setCurrentDrdaResultSet(Pkgnamcsn pkgnamcsn)
pkgnamcsn
- The pkgid section number and unique resultset
consistency tokenprivate DRDAResultSet getDrdaResultSet(ConsistencyToken consistToken)
private DRDAResultSet getDrdaResultSet(int rsNum)
protected ConsistencyToken addResultSet(java.sql.ResultSet value, int holdValue) throws java.sql.SQLException
value
- - ResultSet to addholdValue
- - Holdability of the ResultSet
java.sql.SQLException
protected int getNumResultSets()
protected ConsistencyToken getResultSetPkgcnstkn(int rsNum)
rsNum
- result set starting with 0
protected int[] getRsDRDATypes()
protected void rsClose() throws java.sql.SQLException
java.sql.SQLException
protected void CLSQRY()
protected boolean wasExplicitlyClosed()
protected void close() throws java.sql.SQLException
java.sql.SQLException
protected void reset()
protected boolean rsIsClosed()
protected void rsSuspend()
protected void setRsPrecision(int index, int precision)
index
- - starting with 1precision
- protected int getRsPrecision(int index)
index
- -starting with 1
protected void setRsScale(int index, int scale)
index
- - starting with 1scale
- protected int getRsScale(int index)
index
- -starting with 1
protected void setRsDRDAType(int index, int type)
index
- - starting with 1type
- protected void clearDrdaParams()
protected int getExtPositionCount()
protected int getExtPosition(int i)
i
- - zero-based index into list of external parameters
protected void addExtPosition(int pos)
pos
- - zero-based index into list of external parametersprotected int getDrdaParamCount()
protected void addDrdaParam(byte t, int l)
t
- - type of the parameterl
- - length in bytes of the parameterprotected void setStreamedParameter(EXTDTAReaderInputStream eis)
protected int getParamDRDAType(int index)
index
- - starting with 1
protected int getParamLen(int index)
index
- - starting with 1
protected int getParamPrecision(int index) throws java.sql.SQLException
index
- parameter index starting with 1
java.sql.SQLException
protected int getParamScale(int index) throws java.sql.SQLException
index
- parameter index starting with 1
java.sql.SQLException
protected int getNumRsCols()
protected int getRsDRDAType(int index)
index
- - starting with 1
protected int getRsLen(int index)
index
- starting with 1
public java.lang.String getResultSetCursorName(int rsNum) throws java.sql.SQLException
rsNum
- - result set # starting with 0
java.sql.SQLException
protected java.lang.String toDebugString(java.lang.String indent)
protected ConsistencyToken calculateResultSetPkgcnstkn(int rsNum)
rsNum
- - result set # starting with 0
protected boolean isCallableStatement()
private boolean isCallableSQL(java.lang.String sql)
private void setupCallableStatementParams(java.sql.CallableStatement cs) throws java.sql.SQLException
java.sql.SQLException
protected static int getOutputParameterTypeFromClassName(java.lang.String objectName)
objectName
- Class name of object being evaluated.
indicating if this an output parameter
public void registerAllOutParams() throws java.sql.SQLException
java.sql.SQLException
public void registerOutParam(int paramNum) throws java.sql.SQLException
java.sql.SQLException
protected boolean hasOutputParams()
boolean isOutputParam(int paramNum)
paramNum
- parameter number starting with 1.
return true if this is an output parameter.int getOutputParamType(int paramNum)
paramNum
- - parameter number starting with 1
int getOutputParamScale(int paramNum)
paramNum
- - parameter number starting with 1
int getOutputParamPrecision(int paramNum)
paramNum
- - parameter number starting with 1
private boolean isDynamicPkgid(java.lang.String pkgid)
private void parsePkgidToFindHoldability()
protected java.sql.ParameterMetaData getParameterMetaData() throws java.sql.SQLException
java.sql.SQLException
private boolean getMoreResults(int current) throws java.sql.SQLException
current
- - flag to pass to Statement.getMoreResults(current)
java.sql.SQLException
Statement.getMoreResults()
private java.lang.String getSQLText()
boolean isRSCloseImplicit(boolean lmtblkprcOK) throws java.sql.SQLException
lmtblkprcOK
- true
if the client expects
QRYCLSIMP to be respected for the LMTBLKPRC protocol
java.sql.SQLException
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |