Array is used collect one column of query result data.
Read a field of type Array into either a natively-typed Java array object or a ResultSet. Accessor methods provide the ability to capture array slices.
Other than the constructor all methods are direct implementations of those specified for java.sql.Array. Please refer to the javadoc for java.sql.Array for detailed descriptions of the functionality and parameters of the methods of this class.
ResultSet#getArray
| Modifier and Type | Field and Description |
|---|---|
| protected @Nullable ArrayDecoding. | arrayList
Value of field as |
| protected @Nullable BaseConnection | connection
A database connection. |
| protected @Nullable byte[] | |
| protected @Nullable String | fieldString
Field value as String. |
| private final ResourceLock | |
| private final int | oid
The OID of this field. |
| Access | Constructor and Description |
|---|---|
| private | |
| public | PgArray(BaseConnection
a database connection connection, int the oid of the array datatype oid, @Nullable String the array data in string form fieldString)Create a new Array. |
| public | PgArray(BaseConnection
a database connection connection, int the oid of the array datatype oid, @Nullable byte[] the array data in byte form fieldBytes)Create a new Array. |
| Modifier and Type | Method and Description |
|---|---|
| private Object | buildArray(ArrayDecoding.
list to be converted into array input,Convert |
| private ArrayDecoding. | |
| private int | |
| public static void | |
| public void | free()
Implements java. This method frees the |
| public Object | getArray()
Implements java. Retrieves the contents of the SQL |
| public Object | getArray(long
the array index of the first element to retrieve;
the first element is at index 1 index, int the number of successive SQL array elements to retrieve count)Implements java. Retrieves a slice of the SQL |
| public Object | getArray(Map<String, Class<?>>
a map)java.util.Map object that contains mappings
of SQL type names to classes in the Java programming languageImplements java. Retrieves the contents of the SQL |
| public Object | getArray(long
the array index of the first element to retrieve;
the first element is at index 1 index, int the number of successive SQL array elements to
retrieve count, @Nullable Map<String, Class<?>> a map)java.util.Map object
that contains SQL type names and the classes in
the Java programming language to which they are mappedImplements java. Retrieves a slice of the SQL |
| public Object | |
| public @Nullable Object | |
| public int | getBaseType()
Implements java. Retrieves the JDBC type of the elements in the array designated
by this |
| public String | getBaseTypeName()
Implements java. Retrieves the SQL type name of the elements in
the array designated by this |
| private BaseConnection | |
| public ResultSet | getResultSet()
Implements java. Retrieves a result set that contains the elements of the SQL
|
| public ResultSet | getResultSet(long
the array index of the first element to retrieve;
the first element is at index 1 index, int the number of successive SQL array elements to retrieve count)Implements java. Retrieves a result set holding the elements of the subarray that
starts at index |
| public ResultSet | getResultSet(@Nullable Map<String, Class<?>>
contains the mapping of SQL user-defined types to
classes in the Java programming language map)Implements java. Retrieves a result set that contains the elements of the SQL
|
| public ResultSet | getResultSet(long
the array index of the first element to retrieve;
the first element is at index 1 index, int the number of successive SQL array elements to retrieve count, @Nullable Map<String, Class<?>> the map)Map object that contains the mapping
of SQL type names to classes in the Java(tm) programming languageImplements java. Retrieves a result set holding the elements of the subarray that
starts at index |
| public ResultSet | |
| public ResultSet | |
| public boolean | |
| private Object | |
| private ResultSet | |
| private int | storeValues(byte[] fieldBytes, List<Tuple> rows, Field[] fields, int elementOid, final int[] dims, int pos, final int thisDimension, int index)
|
| public @Nullable byte[] | |
| public @Nullable String | |
| private String | toString(ArrayDecoding.
Convert array list to PG String representation (e.g. {0,1,2}). |
| arrayList | back to summary |
|---|---|
| protected @Nullable ArrayDecoding. Value of field as | |
| connection | back to summary |
|---|---|
| protected @Nullable BaseConnection connection A database connection. | |
| fieldBytes | back to summary |
|---|---|
| protected @Nullable byte[] fieldBytes | |
| fieldString | back to summary |
|---|---|
| protected @Nullable String fieldString Field value as String. | |
| lock | back to summary |
|---|---|
| private final ResourceLock lock | |
| oid | back to summary |
|---|---|
| private final int oid The OID of this field. | |
| PgArray | back to summary |
|---|---|
| private PgArray(BaseConnection connection, int oid) throws SQLException | |
| PgArray | back to summary |
|---|---|
| public PgArray(BaseConnection connection, int oid, @Nullable String fieldString) throws SQLException Create a new Array.
| |
| PgArray | back to summary |
|---|---|
| public PgArray(BaseConnection connection, int oid, @Nullable byte[] fieldBytes) throws SQLException Create a new Array.
| |
| buildArray | back to summary |
|---|---|
| private Object buildArray(ArrayDecoding. Convert
| |
| buildArrayList | back to summary |
|---|---|
| private ArrayDecoding. Build | |
| calcRemainingDataLength | back to summary |
|---|---|
| private int calcRemainingDataLength(byte[] fieldBytes, int[] dims, int pos, int elementOid, int thisDimension) | |
| escapeArrayElement | back to summary |
|---|---|
| public static void escapeArrayElement(StringBuilder b, String s) | |
| free | back to summary |
|---|---|
| public void free() throws SQLException Implements java. Doc from java. This method frees the
After
| |
| getArray | back to summary |
|---|---|
| public Object getArray() throws SQLException Implements java. Doc from java. Retrieves the contents of the SQL Note When
| |
| getArray | back to summary |
|---|---|
| public Object getArray(long index, int count) throws SQLException Implements java. Doc from java. Retrieves a slice of the SQL Note When
| |
| getArray | back to summary |
|---|---|
| public Object getArray(Map<String, Class<?>> map) throws SQLException Implements java. Doc from java. Retrieves the contents of the SQL Note When
| |
| getArray | back to summary |
|---|---|
| public Object getArray(long index, int count, @Nullable Map<String, Class<?>> map) throws SQLException Implements java. Doc from java. Retrieves a slice of the SQL
This method uses
the specified Note When
| |
| getArrayImpl | back to summary |
|---|---|
public Object getArrayImpl(Map<String, Class<?>> map) throws SQLException
| |
| getArrayImpl | back to summary |
|---|---|
| public @Nullable Object getArrayImpl(long index, int count, @Nullable Map<String, Class<?>> map) throws SQLException | |
| getBaseType | back to summary |
|---|---|
| public int getBaseType() throws SQLException Implements java. Doc from java. Retrieves the JDBC type of the elements in the array designated
by this
| |
| getBaseTypeName | back to summary |
|---|---|
| public String getBaseTypeName() throws SQLException Implements java. Doc from java. Retrieves the SQL type name of the elements in
the array designated by this
| |
| getConnection | back to summary |
|---|---|
| private BaseConnection getConnection() | |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet() throws SQLException Implements java. Doc from java. Retrieves a result set that contains the elements of the SQL
The result set contains one row for each array element, with two columns in each row. The second column stores the element value; the first column stores the index into the array for that element (with the first array element being at index 1). The rows are in ascending order corresponding to the order of the indices.
| |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet(long index, int count) throws SQLException Implements java. Doc from java. Retrieves a result set holding the elements of the subarray that
starts at index
The result set has one row for each element of the SQL array
designated by this object, with the first row containing the
element at index
| |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet(@Nullable Map<String, Class<?>> map) throws SQLException Implements java. Doc from java. Retrieves a result set that contains the elements of the SQL
The result set contains one row for each array element, with two columns in each row. The second column stores the element value; the first column stores the index into the array for that element (with the first array element being at index 1). The rows are in ascending order corresponding to the order of the indices.
| |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet(long index, int count, @Nullable Map<String, Class<?>> map) throws SQLException Implements java. Doc from java. Retrieves a result set holding the elements of the subarray that
starts at index
The result set has one row for each element of the SQL array
designated by this object, with the first row containing the
element at index
| |
| getResultSetImpl | back to summary |
|---|---|
| public ResultSet getResultSetImpl(@Nullable Map<String, Class<?>> map) throws SQLException | |
| getResultSetImpl | back to summary |
|---|---|
| public ResultSet getResultSetImpl(long index, int count, @Nullable Map<String, Class<?>> map) throws SQLException | |
| isBinary | back to summary |
|---|---|
| public boolean isBinary() | |
| readBinaryArray | back to summary |
|---|---|
| private Object readBinaryArray(byte[] fieldBytes, int index, int count) throws SQLException | |
| readBinaryResultSet | back to summary |
|---|---|
| private ResultSet readBinaryResultSet(byte[] fieldBytes, int index, int count) throws SQLException | |
| storeValues | back to summary |
|---|---|
| private int storeValues(byte[] fieldBytes, List<Tuple> rows, Field[] fields, int elementOid, final int[] dims, int pos, final int thisDimension, int index) throws SQLException | |
| toBytes | back to summary |
|---|---|
| public @Nullable byte[] toBytes() | |
| toString | back to summary |
|---|---|
| public @Nullable String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| toString | back to summary |
|---|---|
| private String toString(ArrayDecoding. Convert array list to PG String representation (e.g. {0,1,2}). | |