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

public final class Counted extends Object implements Query
Check if this query is a count query.
Since:
0.8.0
  • Constructor Details

    • Counted

      public Counted(Query query)
      Ctor.
      Parameters:
      query - The SQL query
  • 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