public class PgArray extends Object implements Array
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(int)| Modifier and Type | Field and Description |
|---|---|
protected org.postgresql.jdbc.ArrayDecoding.PgArrayList |
arrayList
Value of field as
ArrayDecoding.PgArrayList. |
protected @Nullable BaseConnection |
connection
A database connection.
|
protected byte[] |
fieldBytes |
protected @Nullable String |
fieldString
Field value as String.
|
| Constructor and Description |
|---|
PgArray(BaseConnection connection,
int oid,
byte[] fieldBytes)
Create a new Array.
|
PgArray(BaseConnection connection,
int oid,
@Nullable String fieldString)
Create a new Array.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
escapeArrayElement(StringBuilder b,
String s) |
void |
free() |
Object |
getArray() |
Object |
getArray(long index,
int count) |
Object |
getArray(long index,
int count,
@Nullable Map<String,Class<?>> map) |
Object |
getArray(Map<String,Class<?>> map) |
@Nullable Object |
getArrayImpl(long index,
int count,
@Nullable Map<String,Class<?>> map) |
Object |
getArrayImpl(Map<String,Class<?>> map) |
int |
getBaseType() |
String |
getBaseTypeName() |
ResultSet |
getResultSet() |
ResultSet |
getResultSet(long index,
int count) |
ResultSet |
getResultSet(long index,
int count,
@Nullable Map<String,Class<?>> map) |
ResultSet |
getResultSet(@Nullable Map<String,Class<?>> map) |
ResultSet |
getResultSetImpl(long index,
int count,
@Nullable Map<String,Class<?>> map) |
ResultSet |
getResultSetImpl(@Nullable Map<String,Class<?>> map) |
boolean |
isBinary() |
byte[] |
toBytes() |
@Nullable String |
toString() |
protected @Nullable BaseConnection connection
protected @Nullable String fieldString
protected org.postgresql.jdbc.ArrayDecoding.PgArrayList arrayList
ArrayDecoding.PgArrayList. Will be initialized only once within
buildArrayList(String).protected byte[] fieldBytes
public PgArray(BaseConnection connection, int oid, @Nullable String fieldString) throws SQLException
connection - a database connectionoid - the oid of the array datatypefieldString - the array data in string formSQLException - if something wrong happenspublic PgArray(BaseConnection connection, int oid, byte[] fieldBytes) throws SQLException
connection - a database connectionoid - the oid of the array datatypefieldBytes - the array data in byte formSQLException - if something wrong happenspublic Object getArray() throws SQLException
getArray in interface ArraySQLExceptionpublic Object getArray(long index, int count) throws SQLException
getArray in interface ArraySQLExceptionpublic Object getArrayImpl(Map<String,Class<?>> map) throws SQLException
SQLExceptionpublic Object getArray(Map<String,Class<?>> map) throws SQLException
getArray in interface ArraySQLExceptionpublic Object getArray(long index, int count, @Nullable Map<String,Class<?>> map) throws SQLException
getArray in interface ArraySQLExceptionpublic @Nullable Object getArrayImpl(long index, int count, @Nullable Map<String,Class<?>> map) throws SQLException
SQLExceptionpublic int getBaseType()
throws SQLException
getBaseType in interface ArraySQLExceptionpublic String getBaseTypeName() throws SQLException
getBaseTypeName in interface ArraySQLExceptionpublic ResultSet getResultSet() throws SQLException
getResultSet in interface ArraySQLExceptionpublic ResultSet getResultSet(long index, int count) throws SQLException
getResultSet in interface ArraySQLExceptionpublic ResultSet getResultSet(@Nullable Map<String,Class<?>> map) throws SQLException
getResultSet in interface ArraySQLExceptionpublic ResultSet getResultSet(long index, int count, @Nullable Map<String,Class<?>> map) throws SQLException
getResultSet in interface ArraySQLExceptionpublic ResultSet getResultSetImpl(@Nullable Map<String,Class<?>> map) throws SQLException
SQLExceptionpublic ResultSet getResultSetImpl(long index, int count, @Nullable Map<String,Class<?>> map) throws SQLException
SQLExceptionpublic static void escapeArrayElement(StringBuilder b, String s)
public boolean isBinary()
public byte[] toBytes()
public void free()
throws SQLException
free in interface ArraySQLExceptionCopyright © 1997-2020 PostgreSQL Global Development Group. All Rights Reserved.