Class PreparedStatement

java.lang.Object
io.vertx.mutiny.sqlclient.PreparedStatement
All Implemented Interfaces:
MutinyDelegate

public class PreparedStatement extends Object implements MutinyDelegate
A prepared statement, the statement is pre-compiled and it's more efficient to execute the statement for multiple times. In addition, this kind of statement provides protection against SQL injection attacks.

From a prepared statement you can

NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

  • Field Details

  • Constructor Details

    • PreparedStatement

      public PreparedStatement(io.vertx.sqlclient.PreparedStatement delegate)
    • PreparedStatement

      public PreparedStatement(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.sqlclient.PreparedStatement getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate used by this Mutiny object of generated type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • query

      public PreparedQuery<RowSet<Row>> query()
      Returns:
      the prepared query
    • cursor

      public Cursor cursor()
      Returns:
    • cursor

      public Cursor cursor(Tuple args)
      Parameters:
      args - the list of arguments
      Returns:
      the query
    • createStream

      public RowStream<Row> createStream(int fetch)
      Parameters:
      fetch -
      Returns:
    • createStream

      public RowStream<Row> createStream(int fetch, Tuple args)
      Parameters:
      fetch - the cursor fetch size
      args - the prepared query arguments
      Returns:
      the createStream
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Like close() but notifies the completionHandler when it's closed.

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • closeAndAwait

      public Void closeAndAwait()
      Blocking variant of close().

      This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      the Void instance produced by the operation.
    • closeAndForget

      public void closeAndForget()
      Variant of close() that ignores the result of the operation.

      This method subscribes on the result of close(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from close() but you don't need to compose it with other operations.

    • newInstance

      public static PreparedStatement newInstance(io.vertx.sqlclient.PreparedStatement arg)