Package org.h2.jdbc

Class JdbcArray

All Implemented Interfaces:
Array

public final class JdbcArray extends TraceObject implements Array
Represents an ARRAY value.
  • Field Details

  • Constructor Details

    • JdbcArray

      public JdbcArray(JdbcConnection conn, Value value, int id)
      INTERNAL
      Parameters:
      conn - it belongs to
      value - of
      id - of the trace object
  • Method Details

    • getArray

      public Object getArray() throws SQLException
      Returns the value as a Java array. This method always returns an Object[].
      Specified by:
      getArray in interface Array
      Returns:
      the Object array
      Throws:
      SQLException
    • getArray

      public Object getArray(Map<String,Class<?>> map) throws SQLException
      Returns the value as a Java array. This method always returns an Object[].
      Specified by:
      getArray in interface Array
      Parameters:
      map - is ignored. Only empty or null maps are supported
      Returns:
      the Object array
      Throws:
      SQLException
    • getArray

      public Object getArray(long index, int count) throws SQLException
      Returns the value as a Java array. A subset of the array is returned, starting from the index (1 meaning the first element) and up to the given object count. This method always returns an Object[].
      Specified by:
      getArray in interface Array
      Parameters:
      index - the start index of the subset (starting with 1)
      count - the maximum number of values
      Returns:
      the Object array
      Throws:
      SQLException
    • getArray

      public Object getArray(long index, int count, Map<String,Class<?>> map) throws SQLException
      Returns the value as a Java array. A subset of the array is returned, starting from the index (1 meaning the first element) and up to the given object count. This method always returns an Object[].
      Specified by:
      getArray in interface Array
      Parameters:
      index - the start index of the subset (starting with 1)
      count - the maximum number of values
      map - is ignored. Only empty or null maps are supported
      Returns:
      the Object array
      Throws:
      SQLException
    • getBaseType

      public int getBaseType() throws SQLException
      Returns the base type of the array.
      Specified by:
      getBaseType in interface Array
      Returns:
      the base type or Types.NULL
      Throws:
      SQLException
    • getBaseTypeName

      public String getBaseTypeName() throws SQLException
      Returns the base type name of the array. This database does support mixed type arrays and therefore there is no base type.
      Specified by:
      getBaseTypeName in interface Array
      Returns:
      the base type name or "NULL"
      Throws:
      SQLException
    • getResultSet

      public ResultSet getResultSet() throws SQLException
      Returns the value as a result set. The first column contains the index (starting with 1) and the second column the value.
      Specified by:
      getResultSet in interface Array
      Returns:
      the result set
      Throws:
      SQLException
    • getResultSet

      public ResultSet getResultSet(Map<String,Class<?>> map) throws SQLException
      Returns the value as a result set. The first column contains the index (starting with 1) and the second column the value.
      Specified by:
      getResultSet in interface Array
      Parameters:
      map - is ignored. Only empty or null maps are supported
      Returns:
      the result set
      Throws:
      SQLException
    • getResultSet

      public ResultSet getResultSet(long index, int count) throws SQLException
      Returns the value as a result set. The first column contains the index (starting with 1) and the second column the value. A subset of the array is returned, starting from the index (1 meaning the first element) and up to the given object count.
      Specified by:
      getResultSet in interface Array
      Parameters:
      index - the start index of the subset (starting with 1)
      count - the maximum number of values
      Returns:
      the result set
      Throws:
      SQLException
    • getResultSet

      public ResultSet getResultSet(long index, int count, Map<String,Class<?>> map) throws SQLException
      Returns the value as a result set. The first column contains the index (starting with 1) and the second column the value. A subset of the array is returned, starting from the index (1 meaning the first element) and up to the given object count.
      Specified by:
      getResultSet in interface Array
      Parameters:
      index - the start index of the subset (starting with 1)
      count - the maximum number of values
      map - is ignored. Only empty or null maps are supported
      Returns:
      the result set
      Throws:
      SQLException
    • free

      public void free()
      Release all resources of this object.
      Specified by:
      free in interface Array
    • getResultSetImpl

      private ResultSet getResultSetImpl(long index, int count)
    • checkClosed

      private void checkClosed()
    • get

      private Object get()
    • get

      private Object get(long index, int count)
    • checkRange

      private static int checkRange(long index, int count, int len)
    • toString

      public String toString()
      INTERNAL
      Overrides:
      toString in class Object