java.lang.Object
com.github.fabriciofx.cactoos.jdbc.query.BatchOf
All Implemented Interfaces:
Query, org.cactoos.Text

public final class BatchOf extends Object implements Query
StatementBatch query.
Since:
0.1
  • Constructor Details

    • BatchOf

      public BatchOf(String sql, Params... prms)
      Ctor.
      Parameters:
      sql - The SQL query
      prms - A list of SQL query parameters
    • BatchOf

      public BatchOf(org.cactoos.Text sql, Params... prms)
      Ctor.
      Parameters:
      sql - The SQL query
      prms - A list of SQL query parameters
    • BatchOf

      public BatchOf(org.cactoos.Text sql, Iterable<Params> prms)
      Ctor.
      Parameters:
      sql - The SQL query
      prms - A list of SQL query parameters
  • Method Details

    • prepared

      public PreparedStatement prepared(Connection connection) throws Exception
      Description copied from interface: Query
      Create a PreparedStatement.
      Specified by:
      prepared in interface Query
      Parameters:
      connection - A connection to the DataSource
      Returns:
      A PreparedStatement
      Throws:
      Exception - If fails
    • params

      public Params params()
      Description copied from interface: Query
      Return the Query params.
      Specified by:
      params in interface Query
      Returns:
      The query parameters
    • named

      public String named()
      Description copied from interface: Query
      Return a named query string.
      Specified by:
      named in interface Query
      Returns:
      A named query string
    • asString

      public String asString() throws Exception
      Specified by:
      asString in interface org.cactoos.Text
      Throws:
      Exception