Top Description Fields Constructors Methods
org.postgresql.core.v3

pack-priv Class CompositeParameterList

extends Object
implements V3ParameterList
Class Inheritance
All Implemented Interfaces
org.postgresql.core.v3.V3ParameterList, org.postgresql.core.ParameterList
Imports
org.postgresql.core.ParameterList, org.postgresql.util.ByteStreamWriter, .GT, .PSQLException, .PSQLState, org.checkerframework.checker.index.qual.NonNegative, .Positive, org.checkerframework.checker.nullness.qual.Nullable, java.io.InputStream, java.sql.SQLException

Parameter list for V3 query strings that contain multiple statements. We delegate to one SimpleParameterList per statement, and translate parameter indexes as needed.
Author
Oliver Jowett ([email protected])

Field Summary

Modifier and TypeField and Description
private final int[]
private final SimpleParameterList[]
private final @Positive int

Constructor Summary

AccessConstructor and Description
pack-priv
CompositeParameterList(SimpleParameterList[] subparams, int[] offsets)

Method Summary

Modifier and TypeMethod and Description
public void
appendAll(ParameterList
of parameters to append with.
list
)

Implements org.postgresql.core.ParameterList.appendAll.

Use this operation to append more parameters to the current list.

public void
checkAllParametersSet()

Implements org.postgresql.core.v3.V3ParameterList.checkAllParametersSet.

Ensure that all parameters in this list have been assigned values.

public void
clear()

Implements org.postgresql.core.ParameterList.clear.

Unbind all parameter values bound in this list.

public void
convertFunctionOutParameters()

Implements org.postgresql.core.v3.V3ParameterList.convertFunctionOutParameters.

Convert any function output parameters to the correct type (void) and set an ignorable value for it.

public ParameterList
copy()

Implements org.postgresql.core.ParameterList.copy.

Perform a shallow copy of this ParameterList, returning a new instance (still suitable for passing to the owning Query).

private int
public int
getDirection(int i)

public @Nullable byte[][]
getEncoding()

Implements org.postgresql.core.v3.V3ParameterList.getEncoding.

Return the encoding for each parameter.

public @Nullable byte[]
getFlags()

Implements org.postgresql.core.v3.V3ParameterList.getFlags.

Return the flags for each parameter.

public @NonNegative int
getInParameterCount()

Implements org.postgresql.core.ParameterList.getInParameterCount.

Get the number of IN parameters in this list.

public @NonNegative int
getOutParameterCount()

Implements org.postgresql.core.ParameterList.getOutParameterCount.

Get the number of OUT parameters in this list.

public @NonNegative int
getParameterCount()

Implements org.postgresql.core.ParameterList.getParameterCount.

Get the number of parameters in this list.

public @Nullable int[]
getParamTypes()

Implements org.postgresql.core.v3.V3ParameterList.getParamTypes.

Return the parameter type information.

public @Nullable SimpleParameterList[]
getSubparams()

Implements org.postgresql.core.v3.V3ParameterList.getSubparams.

Return a list of the SimpleParameterList objects that make up this parameter list.

public int[]
getTypeOIDs()

Implements org.postgresql.core.ParameterList.getTypeOIDs.

Return the oids of the parameters in this list.

public @Nullable @Nullable Object[]
getValues()

Implements org.postgresql.core.ParameterList.getValues.

Returns the bound parameter values.

public void
registerOutParameter(@Positive int index, int sqlType)

public void
setBinaryParameter(@Positive int index, byte[] value, int oid)

public void
setBytea(@Positive int index, byte[] data, int offset, @NonNegative int length)

public void
setBytea(@Positive int index, InputStream stream, @NonNegative int length)

public void
setBytea(@Positive int index, InputStream stream)

public void
setBytea(@Positive int index, ByteStreamWriter writer)

public void
setIntParameter(@Positive int index, int value)

public void
setLiteralParameter(@Positive int index, String value, int oid)

public void
setNull(@Positive int index, int oid)

public void
setStringParameter(@Positive int index, String value, int oid)

public void
setText(@Positive int index, InputStream stream)

public String
toString(@Positive int index, boolean standardConformingStrings)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

offsetsback to summary
private final int[] offsets
subparamsback to summary
private final SimpleParameterList[] subparams
totalback to summary
private final @Positive int total

Constructor Detail

CompositeParameterListback to summary
pack-priv CompositeParameterList(SimpleParameterList[] subparams, int[] offsets)

Method Detail

appendAllback to summary
public void appendAll(ParameterList list) throws SQLException

Implements org.postgresql.core.ParameterList.appendAll.

Doc from org.postgresql.core.ParameterList.appendAll.

Use this operation to append more parameters to the current list.

Parameters
list:ParameterList

of parameters to append with.

Annotations
@Override
Exceptions
SQLException:
fault raised if driver or back end throw an exception
checkAllParametersSetback to summary
public void checkAllParametersSet() throws SQLException

Implements org.postgresql.core.v3.V3ParameterList.checkAllParametersSet.

Doc from org.postgresql.core.v3.V3ParameterList.checkAllParametersSet.

Ensure that all parameters in this list have been assigned values. Return silently if all is well, otherwise throw an appropriate exception.

Annotations
@Override
Exceptions
SQLException:
if not all parameters are set.
clearback to summary
public void clear()

Implements org.postgresql.core.ParameterList.clear.

Doc from org.postgresql.core.ParameterList.clear.

Unbind all parameter values bound in this list.

Annotations
@Override
convertFunctionOutParametersback to summary
public void convertFunctionOutParameters()

Implements org.postgresql.core.v3.V3ParameterList.convertFunctionOutParameters.

Doc from org.postgresql.core.v3.V3ParameterList.convertFunctionOutParameters.

Convert any function output parameters to the correct type (void) and set an ignorable value for it.

Annotations
@Override
copyback to summary
public ParameterList copy()

Implements org.postgresql.core.ParameterList.copy.

Doc from org.postgresql.core.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.

Returns:ParameterList

a new ParameterList instance

Annotations
@Override
findSubParamback to summary
private int findSubParam(@Positive int index) throws SQLException
getDirectionback to summary
public int getDirection(int i)
getEncodingback to summary
public @Nullable byte[][] getEncoding()

Implements org.postgresql.core.v3.V3ParameterList.getEncoding.

Doc from org.postgresql.core.v3.V3ParameterList.getEncoding.

Return the encoding for each parameter.

Returns:@Nullable byte[][]

nested byte array of bytes with encoding information.

Annotations
@Override
getFlagsback to summary
public @Nullable byte[] getFlags()

Implements org.postgresql.core.v3.V3ParameterList.getFlags.

Doc from org.postgresql.core.v3.V3ParameterList.getFlags.

Return the flags for each parameter.

Returns:@Nullable byte[]

an array of bytes used to store flags.

Annotations
@Override
getInParameterCountback to summary
public @NonNegative int getInParameterCount()

Implements org.postgresql.core.ParameterList.getInParameterCount.

Doc from org.postgresql.core.ParameterList.getInParameterCount.

Get the number of IN parameters in this list.

Returns:@NonNegative int

the number of IN parameters in this list

Annotations
@Override
getOutParameterCountback to summary
public @NonNegative int getOutParameterCount()

Implements org.postgresql.core.ParameterList.getOutParameterCount.

Doc from org.postgresql.core.ParameterList.getOutParameterCount.

Get the number of OUT parameters in this list.

Returns:@NonNegative int

the number of OUT parameters in this list

Annotations
@Override
getParameterCountback to summary
public @NonNegative int getParameterCount()

Implements org.postgresql.core.ParameterList.getParameterCount.

Doc from org.postgresql.core.ParameterList.getParameterCount.

Get the number of parameters in this list. This value never changes for a particular instance, and might be zero.

Returns:@NonNegative int

the number of parameters in this list.

Annotations
@Override
getParamTypesback to summary
public @Nullable int[] getParamTypes()

Implements org.postgresql.core.v3.V3ParameterList.getParamTypes.

Doc from org.postgresql.core.v3.V3ParameterList.getParamTypes.

Return the parameter type information.

Returns:@Nullable int[]

an array of org.postgresql.core.Oid type information

Annotations
@Override
getSubparamsback to summary
public @Nullable SimpleParameterList[] getSubparams()

Implements org.postgresql.core.v3.V3ParameterList.getSubparams.

Doc from org.postgresql.core.v3.V3ParameterList.getSubparams.

Return a list of the SimpleParameterList objects that make up this parameter list. If this object is already a SimpleParameterList, returns null (avoids an extra array construction in the common case).

Returns:@Nullable SimpleParameterList[]

an array of single-statement parameter lists, or null if this object is already a single-statement parameter list.

Annotations
@Override
getTypeOIDsback to summary
public int[] getTypeOIDs()

Implements org.postgresql.core.ParameterList.getTypeOIDs.

Doc from org.postgresql.core.ParameterList.getTypeOIDs.

Return the oids of the parameters in this list. May be null for a ParameterList that does not support typing of parameters.

Returns:int[]

oids of the parameters

Annotations
@Override
getValuesback to summary
public @Nullable @Nullable Object[] getValues()

Implements org.postgresql.core.ParameterList.getValues.

Doc from org.postgresql.core.ParameterList.getValues.

Returns the bound parameter values.

Returns:@Nullable @Nullable Object[]

Object array containing the parameter values.

Annotations
@Override
registerOutParameterback to summary
public void registerOutParameter(@Positive int index, int sqlType)
Annotations
@Override
setBinaryParameterback to summary
public void setBinaryParameter(@Positive int index, byte[] value, int oid) throws SQLException
Annotations
@Override
setByteaback to summary
public void setBytea(@Positive int index, byte[] data, int offset, @NonNegative int length) throws SQLException
Annotations
@Override
setByteaback to summary
public void setBytea(@Positive int index, InputStream stream, @NonNegative int length) throws SQLException
Annotations
@Override
setByteaback to summary
public void setBytea(@Positive int index, InputStream stream) throws SQLException
Annotations
@Override
setByteaback to summary
public void setBytea(@Positive int index, ByteStreamWriter writer) throws SQLException
Annotations
@Override
setIntParameterback to summary
public void setIntParameter(@Positive int index, int value) throws SQLException
Annotations
@Override
setLiteralParameterback to summary
public void setLiteralParameter(@Positive int index, String value, int oid) throws SQLException
Annotations
@Override
setNullback to summary
public void setNull(@Positive int index, int oid) throws SQLException
Annotations
@Override
setStringParameterback to summary
public void setStringParameter(@Positive int index, String value, int oid) throws SQLException
Annotations
@Override
setTextback to summary
public void setText(@Positive int index, InputStream stream) throws SQLException
Annotations
@Override
toStringback to summary
public String toString(@Positive int index, boolean standardConformingStrings)
Annotations
@Override