Class PreparedStatement


  • public class PreparedStatement
    extends Object
    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.

    • Constructor Detail

      • PreparedStatement

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

        public PreparedStatement​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.sqlclient.PreparedStatement getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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

        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)