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.SQLException
public void registerOutParameter(int index, int sqlType)
registerOutParameter
in interface ParameterList
public int getDirection(int i)
public int getParameterCount()
ParameterList
getParameterCount
in interface ParameterList
public int getInParameterCount()
ParameterList
getInParameterCount
in interface ParameterList
public int getOutParameterCount()
ParameterList
getOutParameterCount
in interface ParameterList
public int[] getTypeOIDs()
ParameterList
getTypeOIDs
in interface ParameterList
public void setIntParameter(int index, int value) throws java.sql.SQLException
ParameterList
setIntParameter
in interface ParameterList
index
- 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
ParameterList
setLiteralParameter
in interface ParameterList
index
- 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
ParameterList
setStringParameter
in interface ParameterList
index
- 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
ParameterList
setBinaryParameter
in interface ParameterList
index
- 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
ParameterList
setBytea
in interface ParameterList
index
- 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
ParameterList
setBytea
in interface ParameterList
index
- 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
ParameterList
setBytea
in interface ParameterList
index
- 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
ParameterList
setBytea
in interface ParameterList
index
- 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
ParameterList
setText
in interface ParameterList
index
- 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
ParameterList
setNull
in interface ParameterList
index
- 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)
ParameterList
toString
in interface ParameterList
index
- the 1-based parameter index to bind.standardConformingStrings
- true if \ is not an escape character in strings literalspublic ParameterList copy()
ParameterList
copy
in interface ParameterList
public void clear()
ParameterList
clear
in interface ParameterList
public SimpleParameterList[] getSubparams()
V3ParameterList
getSubparams
in interface V3ParameterList
null
if this object is
already a single-statement parameter list.public void checkAllParametersSet() throws java.sql.SQLException
V3ParameterList
checkAllParametersSet
in interface V3ParameterList
java.sql.SQLException
- if not all parameters are set.public byte[][] getEncoding()
V3ParameterList
getEncoding
in interface V3ParameterList
public byte[] getFlags()
V3ParameterList
getFlags
in interface V3ParameterList
public int[] getParamTypes()
V3ParameterList
getParamTypes
in interface V3ParameterList
Oid
type informationpublic java.lang.Object[] getValues()
ParameterList
getValues
in interface ParameterList
public void appendAll(ParameterList list) throws java.sql.SQLException
ParameterList
appendAll
in interface ParameterList
list
- of parameters to append with.java.sql.SQLException
- fault raised if driver or back end throw an exceptionpublic void convertFunctionOutParameters()
V3ParameterList
convertFunctionOutParameters
in interface V3ParameterList