io.vertx.rxjava.sqlclient

## Class PreparedStatement

- java.lang.Object
- - io.vertx.rxjava.sqlclient.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

  - use `query()` to create and execute a `PreparedQuery`
  - use `cursor()` to create a `Cursor`
  - use `createStream(int)` to create a `RowStream`

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<PreparedStatement>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreparedStatement(Object delegate)`
    `PreparedStatement(PreparedStatement delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Like `close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but notifies the `completionHandler` when it's closed.
    `void` | `close(Handler<AsyncResult<Void>> completionHandler)` Like `close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but notifies the `completionHandler` when it's closed.
    `RowStream<Row>` | `createStream(int fetch)` Like `createStream(int)` but with empty arguments.
    `RowStream<Row>` | `createStream(int fetch, Tuple args)` Execute the prepared query with a cursor and createStream the result.
    `Cursor` | `cursor()` Like `cursor()` but with empty arguments.
    `Cursor` | `cursor(Tuple args)` Create a cursor with the provided `arguments`.
    `boolean` | `equals(Object o)`
    `PreparedStatement` | `getDelegate()`
    `int` | `hashCode()`
    `static PreparedStatement` | `newInstance(PreparedStatement arg)`
    `PreparedQuery<RowSet<Row>>` | `query()` Create a prepared query for this statement.
    `Single<Void>` | `rxClose()` Like `close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but notifies the `completionHandler` when it's closed.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<PreparedStatement> __TYPE_ARG

  - ### Constructor Detail

    - #### PreparedStatement

          public PreparedStatement(PreparedStatement delegate)

    - #### PreparedStatement

          public PreparedStatement(Object delegate)

  - ### Method Detail

    - #### 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`

    - #### getDelegate

          public PreparedStatement getDelegate()

    - #### query

          public PreparedQuery<RowSet<Row>> query()

      Create a prepared query for this statement.
      Returns:
        the prepared query

    - #### cursor

          public Cursor cursor()

      Like `cursor()` but with empty arguments.
      Returns:

    - #### cursor

          public Cursor cursor(Tuple args)

      Create a cursor with the provided `arguments`.
      Parameters:
        `args` - the list of arguments
      Returns:
        the query

    - #### createStream

          public RowStream<Row> createStream(int fetch)

      Like `createStream(int)` but with empty arguments.
      Parameters:
        `fetch` -
      Returns:

    - #### createStream

          public RowStream<Row> createStream(int fetch,
                                             Tuple args)

      Execute the prepared query with a cursor and createStream the result. The createStream opens a cursor with a `fetch` size to fetch the results.

      Note: this requires to be in a transaction, since cursors require it.
      Parameters:
        `fetch` - the cursor fetch size
        `args` - the prepared query arguments
      Returns:
        the createStream

    - #### close

          public void close(Handler<AsyncResult<Void>> completionHandler)

      Like `close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but notifies the `completionHandler` when it's closed.
      Parameters:
        `completionHandler` -

    - #### close

          public void close()

      Like `close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but notifies the `completionHandler` when it's closed.

    - #### rxClose

          public Single<Void> rxClose()

      Like `close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but notifies the `completionHandler` when it's closed.
      Returns:

    - #### newInstance

          public static PreparedStatement newInstance(PreparedStatement arg)

Copyright © 2023 Eclipse. All rights reserved.