Abstraction of a list of parameters to be substituted into a Query. The protocol-specific details of how to efficiently store and stream the parameters is hidden behind implementations of this interface.
In general, instances of ParameterList are associated with a particular Query object (the one that created them) and shouldn't be used against another Query.
Parameter indexes are 1-based to match JDBC's PreparedStatement, i.e. the first parameter has index 1.
| Modifier and Type | Method and Description |
|---|---|
| public void | appendAll(ParameterList
of parameters to append with. list)Use this operation to append more parameters to the current list. |
| public void | |
| public ParameterList | Returns: a new ParameterList instancePerform a shallow copy of this ParameterList, returning a new instance (still suitable for passing to the owning Query). |
| public @NonNegative int | Returns: the number of IN parameters in this listGet the number of IN parameters in this list. |
| public @NonNegative int | Returns: the number of OUT parameters in this listGet the number of OUT parameters in this list. |
| public @NonNegative int | Returns: the number of parameters in this list.Get the number of parameters in this list. |
| public int[] | |
| public @Nullable @Nullable Object[] | Returns: Object array containing the parameter values.Returns the bound parameter values. |
| public void | |
| public void | setBinaryParameter(@Positive int
the 1-based parameter index to bind. index, byte[] the bytes to send. value, int the type OID of the parameter. oid)Binds given byte[] value to a parameter. |
| public void | setBytea(@Positive int
the 1-based parameter index to bind. index, byte[] an array containing the raw data value data, @NonNegative int the offset within offset, @NonNegative int data of the start of the parameter data.the number of bytes of parameter data within length)data to use.Binds a binary bytea value stored as a bytearray to a parameter. |
| public void | setBytea(@Positive int
the 1-based parameter index to bind. index, InputStream a stream containing the parameter data. stream, @NonNegative int the number of bytes of parameter data to read from length)stream.Binds a binary bytea value stored as an InputStream. |
| public void | setBytea(@Positive int
the 1-based parameter index to bind. index, InputStream a stream containing the parameter data. stream)Binds a binary bytea value stored as an InputStream. |
| public void | setBytea(@Positive int
the 1-based parameter index to bind. index, ByteStreamWriter a writer that can write the bytes for the parameter writer)Binds a binary bytea value stored as a ByteStreamWriter. |
| public void | setIntParameter(@Positive int
the 1-based parameter index to bind. index, int the integer value to use. value)Binds an integer value to a parameter. |
| public void | setLiteralParameter(@Positive int
the 1-based parameter index to bind. index, String the unquoted literal string to use. value, int the type OID of the parameter, or oid)0 to infer the type.Binds a String value that is an unquoted literal to the server's query parser (for example, a bare integer) to a parameter. |
| public void | |
| public void | setStringParameter(@Positive int
the 1-based parameter index to bind. index, String the quoted string to use. value, int the type OID of the parameter, or oid)0 to infer the type.Binds a String value that needs to be quoted for the server's parser to understand (for example, a timestamp) to a parameter. |
| public void | setText(@Positive int
the 1-based parameter index to bind. index, InputStream a stream containing the parameter data. stream)Binds a text value stored as an InputStream that is a valid UTF-8 byte stream. |
| public String |
| appendAll | back to summary |
|---|---|
| public void appendAll(ParameterList list) throws SQLException Use this operation to append more parameters to the current list.
| |
| clear | back to summary |
|---|---|
| public void clear() Unbind all parameter values bound in this list. | |
| copy | back to summary |
|---|---|
| public ParameterList copy() Perform a shallow copy of this ParameterList, returning a new instance (still suitable for passing to the owning Query). If this ParameterList is immutable, copy() may return the same immutable object.
| |
| getInParameterCount | back to summary |
|---|---|
| public @NonNegative int getInParameterCount() Get the number of IN parameters in this list.
| |
| getOutParameterCount | back to summary |
|---|---|
| public @NonNegative int getOutParameterCount() Get the number of OUT parameters in this list.
| |
| getParameterCount | back to summary |
|---|---|
| public @NonNegative int getParameterCount() Get the number of parameters in this list. This value never changes for a particular instance, and might be zero.
| |
| getTypeOIDs | back to summary |
|---|---|
| public int[] getTypeOIDs() Return the oids of the parameters in this list. May be null for a ParameterList that does not support typing of parameters.
| |
| getValues | back to summary |
|---|---|
| public @Nullable @Nullable Object[] getValues() Returns the bound parameter values. | |
| registerOutParameter | back to summary |
|---|---|
| public void registerOutParameter(@Positive int index, int sqlType) throws SQLException | |
| setBinaryParameter | back to summary |
|---|---|
| public void setBinaryParameter(@Positive int index, byte[] value, int oid) throws SQLException Binds given byte[] value to a parameter. The bytes must already be in correct format matching the OID.
| |
| setBytea | back to summary |
|---|---|
| public void setBytea(@Positive int index, byte[] data, @NonNegative int offset, @NonNegative int length) throws SQLException Binds a binary bytea value stored as a bytearray to a parameter. The parameter's type is implicitly set to 'bytea'. The bytearray's contains should remain unchanged until query execution has completed.
| |
| setBytea | back to summary |
|---|---|
| public void setBytea(@Positive int index, InputStream stream, @NonNegative int length) throws SQLException Binds a binary bytea value stored as an InputStream. The parameter's type is implicitly set to 'bytea'. The stream should remain valid until query execution has completed.
| |
| setBytea | back to summary |
|---|---|
| public void setBytea(@Positive int index, InputStream stream) throws SQLException Binds a binary bytea value stored as an InputStream. The parameter's type is implicitly set to 'bytea'. The stream should remain valid until query execution has completed.
| |
| setBytea | back to summary |
|---|---|
| public void setBytea(@Positive int index, ByteStreamWriter writer) throws SQLException Binds a binary bytea value stored as a ByteStreamWriter. The parameter's type is implicitly set to 'bytea'. The stream should remain valid until query execution has completed.
| |
| setIntParameter | back to summary |
|---|---|
| public void setIntParameter(@Positive int index, int value) throws SQLException Binds an integer value to a parameter. The type of the parameter is implicitly 'int4'.
| |
| setLiteralParameter | back to summary |
|---|---|
| public void setLiteralParameter(@Positive int index, String value, int oid) throws SQLException Binds a String value that is an unquoted literal to the server's query parser (for example, a bare integer) to a parameter. Associated with the parameter is a typename for the parameter that should correspond to an entry in pg_types.
| |
| setNull | back to summary |
|---|---|
| public void setNull(@Positive int index, int oid) throws SQLException Binds a SQL NULL value to a parameter. Associated with the parameter is a typename for the parameter that should correspond to an entry in pg_types.
| |
| setStringParameter | back to summary |
|---|---|
| public void setStringParameter(@Positive int index, String value, int oid) throws SQLException Binds a String value that needs to be quoted for the server's parser to understand (for example, a timestamp) to a parameter. Associated with the parameter is a typename for the parameter that should correspond to an entry in pg_types.
| |
| setText | back to summary |
|---|---|
| public void setText(@Positive int index, InputStream stream) throws SQLException Binds a text value stored as an InputStream that is a valid UTF-8 byte stream. Any byte-order marks (BOM) in the stream are passed to the backend. The parameter's type is implicitly set to 'text'. The stream should remain valid until query execution has completed.
| |
| toString | back to summary |
|---|---|
| public String toString(@Positive int index, boolean standardConformingStrings) Return a human-readable representation of a particular parameter in this ParameterList. If the parameter is not bound, returns "?". | |