Class MySQLConnection


  • public class MySQLConnection
    extends SqlConnection
    An interface which represents a connection to MySQL server.

    The connection object supports all the operations defined in the interface, in addition it provides MySQL utility command support:

    • COM_PING
    • COM_CHANGE_USER
    • COM_RESET_CONNECTION
    • COM_DEBUG
    • COM_INIT_DB
    • COM_STATISTICS
    • COM_SET_OPTION

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

    • Constructor Detail

      • MySQLConnection

        public MySQLConnection​(io.vertx.mysqlclient.MySQLConnection delegate)
      • MySQLConnection

        public MySQLConnection​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.mysqlclient.MySQLConnection getDelegate()
        Overrides:
        getDelegate in class SqlConnection
      • connect

        public static void connect​(Vertx vertx,
                                   io.vertx.mysqlclient.MySQLConnectOptions connectOptions,
                                   io.vertx.core.Handler<io.vertx.core.AsyncResult<MySQLConnection>> handler)
        Create a connection to MySQL server with the given connectOptions.
        Parameters:
        vertx - the vertx instance
        connectOptions - the options for the connection
        handler - the handler called with the connection or the failure
      • connect

        public static void connect​(Vertx vertx,
                                   io.vertx.mysqlclient.MySQLConnectOptions connectOptions)
        Create a connection to MySQL server with the given connectOptions.
        Parameters:
        vertx - the vertx instance
        connectOptions - the options for the connection
      • rxConnect

        public static rx.Single<MySQLConnection> rxConnect​(Vertx vertx,
                                                           io.vertx.mysqlclient.MySQLConnectOptions connectOptions)
        Create a connection to MySQL server with the given connectOptions.
        Parameters:
        vertx - the vertx instance
        connectOptions - the options for the connection
        Returns:
      • ping

        public MySQLConnection ping​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Send a PING command to check if the server is alive.
        Parameters:
        handler - the handler notified when the server responses to client
        Returns:
        a reference to this, so the API can be used fluently
      • ping

        public MySQLConnection ping()
        Send a PING command to check if the server is alive.
        Returns:
        a reference to this, so the API can be used fluently
      • rxPing

        public rx.Single<Void> rxPing()
        Send a PING command to check if the server is alive.
        Returns:
        a reference to this, so the API can be used fluently
      • specifySchema

        public MySQLConnection specifySchema​(String schemaName,
                                             io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Send a INIT_DB command to change the default schema of the connection.
        Parameters:
        schemaName - name of the schema to change to
        handler - the handler notified with the execution result
        Returns:
        a reference to this, so the API can be used fluently
      • specifySchema

        public MySQLConnection specifySchema​(String schemaName)
        Send a INIT_DB command to change the default schema of the connection.
        Parameters:
        schemaName - name of the schema to change to
        Returns:
        a reference to this, so the API can be used fluently
      • rxSpecifySchema

        public rx.Single<Void> rxSpecifySchema​(String schemaName)
        Send a INIT_DB command to change the default schema of the connection.
        Parameters:
        schemaName - name of the schema to change to
        Returns:
        a reference to this, so the API can be used fluently
      • getInternalStatistics

        public MySQLConnection getInternalStatistics​(io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> handler)
        Send a STATISTICS command to get a human readable string of the server internal status.
        Parameters:
        handler - the handler notified with the execution result
        Returns:
        a reference to this, so the API can be used fluently
      • getInternalStatistics

        public MySQLConnection getInternalStatistics()
        Send a STATISTICS command to get a human readable string of the server internal status.
        Returns:
        a reference to this, so the API can be used fluently
      • rxGetInternalStatistics

        public rx.Single<String> rxGetInternalStatistics()
        Send a STATISTICS command to get a human readable string of the server internal status.
        Returns:
        a reference to this, so the API can be used fluently
      • setOption

        public MySQLConnection setOption​(io.vertx.mysqlclient.MySQLSetOption option,
                                         io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Send a SET_OPTION command to set options for the current connection.
        Parameters:
        option - the options to set
        handler - the handler notified with the execution result
        Returns:
        a reference to this, so the API can be used fluently
      • setOption

        public MySQLConnection setOption​(io.vertx.mysqlclient.MySQLSetOption option)
        Send a SET_OPTION command to set options for the current connection.
        Parameters:
        option - the options to set
        Returns:
        a reference to this, so the API can be used fluently
      • rxSetOption

        public rx.Single<Void> rxSetOption​(io.vertx.mysqlclient.MySQLSetOption option)
        Send a SET_OPTION command to set options for the current connection.
        Parameters:
        option - the options to set
        Returns:
        a reference to this, so the API can be used fluently
      • resetConnection

        public MySQLConnection resetConnection​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Send a RESET_CONNECTION command to reset the session state.
        Parameters:
        handler - the handler notified with the execution result
        Returns:
        a reference to this, so the API can be used fluently
      • resetConnection

        public MySQLConnection resetConnection()
        Send a RESET_CONNECTION command to reset the session state.
        Returns:
        a reference to this, so the API can be used fluently
      • rxResetConnection

        public rx.Single<Void> rxResetConnection()
        Send a RESET_CONNECTION command to reset the session state.
        Returns:
        a reference to this, so the API can be used fluently
      • debug

        public MySQLConnection debug​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Send a DEBUG command to dump debug information to the server's stdout.
        Parameters:
        handler - the handler notified with the execution result
        Returns:
        a reference to this, so the API can be used fluently
      • debug

        public MySQLConnection debug()
        Send a DEBUG command to dump debug information to the server's stdout.
        Returns:
        a reference to this, so the API can be used fluently
      • rxDebug

        public rx.Single<Void> rxDebug()
        Send a DEBUG command to dump debug information to the server's stdout.
        Returns:
        a reference to this, so the API can be used fluently
      • changeUser

        public MySQLConnection changeUser​(io.vertx.mysqlclient.MySQLAuthOptions options,
                                          io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.
        Parameters:
        options - authentication options
        handler - the handler
        Returns:
        a reference to this, so the API can be used fluently
      • changeUser

        public MySQLConnection changeUser​(io.vertx.mysqlclient.MySQLAuthOptions options)
        Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.
        Parameters:
        options - authentication options
        Returns:
        a reference to this, so the API can be used fluently
      • rxChangeUser

        public rx.Single<Void> rxChangeUser​(io.vertx.mysqlclient.MySQLAuthOptions options)
        Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.
        Parameters:
        options - authentication options
        Returns:
        a reference to this, so the API can be used fluently
      • newInstance

        public static MySQLConnection newInstance​(io.vertx.mysqlclient.MySQLConnection arg)