Class ArrayCreateQuery

All Implemented Interfaces:
CreateQuery<Array>, Query

public class ArrayCreateQuery extends AbstractCreateQuery<Array>
A query implementation for creating a SQL array.

This class extends AbstractCreateQuery to provide functionality for creating SQL arrays in a database. It handles the creation of JDBC Array objects by specifying the SQL type name and array elements.

  • Field Details

    • typeName

      protected String typeName
      The SQL type name of the array.
    • elements

      protected Object[] elements
      The array elements.
  • Constructor Details

    • ArrayCreateQuery

      public ArrayCreateQuery()
  • Method Details

    • prepare

      public void prepare()
      Prepares this query for execution. This method must be called before create(Connection).
      Specified by:
      prepare in interface Query
      Overrides:
      prepare in class AbstractQuery
    • getTypeName

      public String getTypeName()
      Returns the SQL type name of the array.
      Returns:
      the SQL type name
    • setTypeName

      public void setTypeName(String typeName)
      Sets the SQL type name of the array.
      Parameters:
      typeName - the SQL type name
    • getElements

      public Object[] getElements()
      Returns the array elements.
      Returns:
      the array elements
    • setElements

      public void setElements(Object[] elements)
      Sets the array elements.
      Parameters:
      elements - the array elements
    • create

      public Array create(Connection connection) throws SQLException
      Creates a SQL array.
      Parameters:
      connection - the JDBC connection
      Returns:
      the created SQL array
      Throws:
      SQLException - if a database access error occurs