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 RX-ified interface using Vert.x codegen.

    • Field Detail

      • __TYPE_ARG

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

      • PreparedStatement

        public PreparedStatement​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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,
                                           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 Completable close()
        Close the prepared query and release its resources.
        Returns:
      • rxClose

        public Completable rxClose()
        Close the prepared query and release its resources.
        Returns: