Class SqlConnection

    • Constructor Detail

      • SqlConnection

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

        public SqlConnection​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.sqlclient.SqlConnection getDelegate()
        Overrides:
        getDelegate in class SqlClient
      • prepare

        public SqlConnection prepare​(String sql,
                                     io.vertx.core.Handler<io.vertx.core.AsyncResult<PreparedStatement>> handler)
        Create a prepared statement using the given sql string.
        Parameters:
        sql - the sql
        handler - the handler notified with the prepared query asynchronously
        Returns:
      • prepare

        public SqlConnection prepare​(String sql)
        Create a prepared statement using the given sql string.
        Parameters:
        sql - the sql
        Returns:
      • rxPrepare

        public rx.Single<PreparedStatement> rxPrepare​(String sql)
        Create a prepared statement using the given sql string.
        Parameters:
        sql - the sql
        Returns:
      • prepare

        public SqlConnection prepare​(String sql,
                                     io.vertx.sqlclient.PrepareOptions options,
                                     io.vertx.core.Handler<io.vertx.core.AsyncResult<PreparedStatement>> handler)
        Create a prepared statement using the given sql string.
        Parameters:
        sql - the sql
        options -
        handler - the handler notified with the prepared query asynchronously
        Returns:
      • prepare

        public SqlConnection prepare​(String sql,
                                     io.vertx.sqlclient.PrepareOptions options)
        Create a prepared statement using the given sql string.
        Parameters:
        sql - the sql
        options -
        Returns:
      • rxPrepare

        public rx.Single<PreparedStatement> rxPrepare​(String sql,
                                                      io.vertx.sqlclient.PrepareOptions options)
        Create a prepared statement using the given sql string.
        Parameters:
        sql - the sql
        options -
        Returns:
      • exceptionHandler

        public SqlConnection exceptionHandler​(io.vertx.core.Handler<Throwable> handler)
        Set an handler called with connection errors.
        Parameters:
        handler - the handler
        Returns:
        a reference to this, so the API can be used fluently
      • closeHandler

        public SqlConnection closeHandler​(io.vertx.core.Handler<Void> handler)
        Set an handler called when the connection is closed.
        Parameters:
        handler - the handler
        Returns:
        a reference to this, so the API can be used fluently
      • begin

        public void begin​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Transaction>> handler)
        Begin a transaction and returns a Transaction for controlling and tracking this transaction.

        When the connection is explicitely closed, any inflight transaction is rollbacked.

        Parameters:
        handler -
      • begin

        public void begin()
        Begin a transaction and returns a Transaction for controlling and tracking this transaction.

        When the connection is explicitely closed, any inflight transaction is rollbacked.

      • rxBegin

        public rx.Single<Transaction> rxBegin()
        Begin a transaction and returns a Transaction for controlling and tracking this transaction.

        When the connection is explicitely closed, any inflight transaction is rollbacked.

        Returns:
      • transaction

        public Transaction transaction()
        Returns:
        the current transaction if it exists, otherwise null
      • isSSL

        public boolean isSSL()
        Returns:
        whether the connection uses SSL
      • close

        public void close​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Close the current connection after all the pending commands have been processed.
        Overrides:
        close in class SqlClient
        Parameters:
        handler - the completion handler
      • close

        public void close()
        Close the current connection after all the pending commands have been processed.
        Overrides:
        close in class SqlClient
      • rxClose

        public rx.Single<Void> rxClose()
        Close the current connection after all the pending commands have been processed.
        Overrides:
        rxClose in class SqlClient
        Returns:
      • databaseMetadata

        public DatabaseMetadata databaseMetadata()
        Returns:
        The static metadata about the backend database server for this connection
      • newInstance

        public static SqlConnection newInstance​(io.vertx.sqlclient.SqlConnection arg)