class CompositeParameterList extends java.lang.Object implements V3ParameterList
| Modifier and Type | Field and Description |
|---|---|
private int[] |
offsets |
private SimpleParameterList[] |
subparams |
private int |
total |
| Constructor and Description |
|---|
CompositeParameterList(SimpleParameterList[] subparams,
int[] offsets) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendAll(ParameterList list)
Use this operation to append more parameters to the current list.
|
void |
checkAllParametersSet()
Ensure that all parameters in this list have been assigned values.
|
void |
clear()
Unbind all parameter values bound in this list.
|
void |
convertFunctionOutParameters()
Convert any function output parameters to the correct type (void) and set an ignorable value
for it.
|
ParameterList |
copy()
Perform a shallow copy of this ParameterList, returning a new instance (still suitable for
passing to the owning Query).
|
private int |
findSubParam(int index) |
int |
getDirection(int i) |
byte[][] |
getEncoding()
Return the encoding for each parameter.
|
byte[] |
getFlags()
Return the flags for each parameter.
|
int |
getInParameterCount()
Get the number of IN parameters in this list.
|
int |
getOutParameterCount()
Get the number of OUT parameters in this list.
|
int |
getParameterCount()
Get the number of parameters in this list.
|
int[] |
getParamTypes()
Return the parameter type information.
|
SimpleParameterList[] |
getSubparams()
Return a list of the SimpleParameterList objects that make up this parameter list.
|
int[] |
getTypeOIDs()
Return the oids of the parameters in this list.
|
java.lang.Object[] |
getValues()
Returns the bound parameter values.
|
void |
registerOutParameter(int index,
int sqlType) |
void |
setBinaryParameter(int index,
byte[] value,
int oid)
Binds given byte[] value to a parameter.
|
void |
setBytea(int index,
byte[] data,
int offset,
int length)
Binds a binary bytea value stored as a bytearray to a parameter.
|
void |
setBytea(int index,
ByteStreamWriter writer)
Binds a binary bytea value stored as a ByteStreamWriter.
|
void |
setBytea(int index,
java.io.InputStream stream)
Binds a binary bytea value stored as an InputStream.
|
void |
setBytea(int index,
java.io.InputStream stream,
int length)
Binds a binary bytea value stored as an InputStream.
|
void |
setIntParameter(int index,
int value)
Binds an integer value to a parameter.
|
void |
setLiteralParameter(int index,
java.lang.String value,
int oid)
Binds a String value that is an unquoted literal to the server's query parser (for example, a
bare integer) to a parameter.
|
void |
setNull(int index,
int oid)
Binds a SQL NULL value to a parameter.
|
void |
setStringParameter(int index,
java.lang.String value,
int oid)
Binds a String value that needs to be quoted for the server's parser to understand (for
example, a timestamp) to a parameter.
|
void |
setText(int index,
java.io.InputStream stream)
Binds a text value stored as an InputStream that is a valid UTF-8 byte stream.
|
java.lang.String |
toString(int index,
boolean standardConformingStrings)
Return a human-readable representation of a particular parameter in this ParameterList.
|
private final int total
private final SimpleParameterList[] subparams
private final int[] offsets
CompositeParameterList(SimpleParameterList[] subparams, int[] offsets)
private int findSubParam(int index)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void registerOutParameter(int index,
int sqlType)
registerOutParameter in interface ParameterListpublic int getDirection(int i)
public int getParameterCount()
ParameterListgetParameterCount in interface ParameterListpublic int getInParameterCount()
ParameterListgetInParameterCount in interface ParameterListpublic int getOutParameterCount()
ParameterListgetOutParameterCount in interface ParameterListpublic int[] getTypeOIDs()
ParameterListgetTypeOIDs in interface ParameterListpublic void setIntParameter(int index,
int value)
throws java.sql.SQLException
ParameterListsetIntParameter in interface ParameterListindex - the 1-based parameter index to bind.value - the integer value to use.java.sql.SQLException - on error or if index is out of rangepublic void setLiteralParameter(int index,
java.lang.String value,
int oid)
throws java.sql.SQLException
ParameterListsetLiteralParameter in interface ParameterListindex - the 1-based parameter index to bind.value - the unquoted literal string to use.oid - the type OID of the parameter, or 0 to infer the type.java.sql.SQLException - on error or if index is out of rangepublic void setStringParameter(int index,
java.lang.String value,
int oid)
throws java.sql.SQLException
ParameterListsetStringParameter in interface ParameterListindex - the 1-based parameter index to bind.value - the quoted string to use.oid - the type OID of the parameter, or 0 to infer the type.java.sql.SQLException - on error or if index is out of rangepublic void setBinaryParameter(int index,
byte[] value,
int oid)
throws java.sql.SQLException
ParameterListsetBinaryParameter in interface ParameterListindex - the 1-based parameter index to bind.value - the bytes to send.oid - the type OID of the parameter.java.sql.SQLException - on error or if index is out of rangepublic void setBytea(int index,
byte[] data,
int offset,
int length)
throws java.sql.SQLException
ParameterListsetBytea in interface ParameterListindex - the 1-based parameter index to bind.data - an array containing the raw data valueoffset - the offset within data of the start of the parameter data.length - the number of bytes of parameter data within data to use.java.sql.SQLException - on error or if index is out of rangepublic void setBytea(int index,
java.io.InputStream stream,
int length)
throws java.sql.SQLException
ParameterListsetBytea in interface ParameterListindex - the 1-based parameter index to bind.stream - a stream containing the parameter data.length - the number of bytes of parameter data to read from stream.java.sql.SQLException - on error or if index is out of rangepublic void setBytea(int index,
java.io.InputStream stream)
throws java.sql.SQLException
ParameterListsetBytea in interface ParameterListindex - the 1-based parameter index to bind.stream - a stream containing the parameter data.java.sql.SQLException - on error or if index is out of rangepublic void setBytea(int index,
ByteStreamWriter writer)
throws java.sql.SQLException
ParameterListsetBytea in interface ParameterListindex - the 1-based parameter index to bind.writer - a writer that can write the bytes for the parameterjava.sql.SQLException - on error or if index is out of rangepublic void setText(int index,
java.io.InputStream stream)
throws java.sql.SQLException
ParameterListsetText in interface ParameterListindex - the 1-based parameter index to bind.stream - a stream containing the parameter data.java.sql.SQLException - on error or if index is out of rangepublic void setNull(int index,
int oid)
throws java.sql.SQLException
ParameterListsetNull in interface ParameterListindex - the 1-based parameter index to bind.oid - the type OID of the parameter, or 0 to infer the type.java.sql.SQLException - on error or if index is out of rangepublic java.lang.String toString(int index,
boolean standardConformingStrings)
ParameterListtoString in interface ParameterListindex - the 1-based parameter index to bind.standardConformingStrings - true if \ is not an escape character in strings literalspublic ParameterList copy()
ParameterListcopy in interface ParameterListpublic void clear()
ParameterListclear in interface ParameterListpublic SimpleParameterList[] getSubparams()
V3ParameterListgetSubparams in interface V3ParameterListnull if this object is
already a single-statement parameter list.public void checkAllParametersSet()
throws java.sql.SQLException
V3ParameterListcheckAllParametersSet in interface V3ParameterListjava.sql.SQLException - if not all parameters are set.public byte[][] getEncoding()
V3ParameterListgetEncoding in interface V3ParameterListpublic byte[] getFlags()
V3ParameterListgetFlags in interface V3ParameterListpublic int[] getParamTypes()
V3ParameterListgetParamTypes in interface V3ParameterListOid type informationpublic java.lang.Object[] getValues()
ParameterListgetValues in interface ParameterListpublic void appendAll(ParameterList list) throws java.sql.SQLException
ParameterListappendAll in interface ParameterListlist - of parameters to append with.java.sql.SQLException - fault raised if driver or back end throw an exceptionpublic void convertFunctionOutParameters()
V3ParameterListconvertFunctionOutParameters in interface V3ParameterList