public interface MySQLConnection extends SqlConnection
The connection object supports all the operations defined in the SqlConnection
interface,
in addition it provides MySQL utility command support:
Modifier and Type | Method and Description |
---|---|
static MySQLConnection |
cast(SqlConnection sqlConnection)
Cast a
SqlConnection to MySQLConnection . |
io.vertx.core.Future<Void> |
changeUser(MySQLAuthOptions options)
Like
changeUser(MySQLAuthOptions, Handler) but returns a Future of the asynchronous result |
MySQLConnection |
changeUser(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.
|
MySQLConnection |
closeHandler(io.vertx.core.Handler<Void> handler) |
static io.vertx.core.Future<MySQLConnection> |
connect(io.vertx.core.Vertx vertx,
MySQLConnectOptions connectOptions)
Like
connect(Vertx, MySQLConnectOptions, Handler) but returns a Future of the asynchronous result |
static void |
connect(io.vertx.core.Vertx vertx,
MySQLConnectOptions connectOptions,
io.vertx.core.Handler<io.vertx.core.AsyncResult<MySQLConnection>> handler)
Create a connection to MySQL server with the given
connectOptions . |
static io.vertx.core.Future<MySQLConnection> |
connect(io.vertx.core.Vertx vertx,
String connectionUri)
Like
connect(Vertx, String, Handler) but returns a Future of the asynchronous result |
static void |
connect(io.vertx.core.Vertx vertx,
String connectionUri,
io.vertx.core.Handler<io.vertx.core.AsyncResult<MySQLConnection>> handler)
Like
connect(Vertx, MySQLConnectOptions, Handler) with options built from connectionUri . |
io.vertx.core.Future<Void> |
debug()
Like
debug(Handler) but returns a Future of the asynchronous result |
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.
|
MySQLConnection |
exceptionHandler(io.vertx.core.Handler<Throwable> handler) |
io.vertx.core.Future<String> |
getInternalStatistics()
Like
getInternalStatistics(Handler) but returns a Future of the asynchronous result |
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.
|
io.vertx.core.Future<Void> |
ping()
Like
ping(Handler) but returns a Future of the asynchronous result |
MySQLConnection |
ping(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
Send a PING command to check if the server is alive.
|
MySQLConnection |
prepare(String sql,
io.vertx.core.Handler<io.vertx.core.AsyncResult<PreparedStatement>> handler) |
io.vertx.core.Future<Void> |
resetConnection()
Like
resetConnection(Handler) but returns a Future of the asynchronous result |
MySQLConnection |
resetConnection(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
Send a RESET_CONNECTION command to reset the session state.
|
io.vertx.core.Future<Void> |
setOption(MySQLSetOption option)
Like
setOption(MySQLSetOption, Handler) but returns a Future of the asynchronous result |
MySQLConnection |
setOption(MySQLSetOption option,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
Send a SET_OPTION command to set options for the current connection.
|
io.vertx.core.Future<Void> |
specifySchema(String schemaName)
Like
specifySchema(String, Handler) but returns a Future of the asynchronous result |
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.
|
begin, begin, close, databaseMetadata, isSSL, prepare
close, preparedQuery, query
static void connect(io.vertx.core.Vertx vertx, MySQLConnectOptions connectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<MySQLConnection>> handler)
connectOptions
.vertx
- the vertx instanceconnectOptions
- the options for the connectionhandler
- the handler called with the connection or the failurestatic io.vertx.core.Future<MySQLConnection> connect(io.vertx.core.Vertx vertx, MySQLConnectOptions connectOptions)
connect(Vertx, MySQLConnectOptions, Handler)
but returns a Future
of the asynchronous resultstatic void connect(io.vertx.core.Vertx vertx, String connectionUri, io.vertx.core.Handler<io.vertx.core.AsyncResult<MySQLConnection>> handler)
connect(Vertx, MySQLConnectOptions, Handler)
with options built from connectionUri
.static io.vertx.core.Future<MySQLConnection> connect(io.vertx.core.Vertx vertx, String connectionUri)
connect(Vertx, String, Handler)
but returns a Future
of the asynchronous resultMySQLConnection prepare(String sql, io.vertx.core.Handler<io.vertx.core.AsyncResult<PreparedStatement>> handler)
prepare
in interface SqlConnection
MySQLConnection exceptionHandler(io.vertx.core.Handler<Throwable> handler)
exceptionHandler
in interface SqlConnection
MySQLConnection closeHandler(io.vertx.core.Handler<Void> handler)
closeHandler
in interface SqlConnection
MySQLConnection ping(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
handler
- the handler notified when the server responses to clientio.vertx.core.Future<Void> ping()
ping(Handler)
but returns a Future
of the asynchronous resultMySQLConnection specifySchema(String schemaName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
schemaName
- name of the schema to change tohandler
- the handler notified with the execution resultio.vertx.core.Future<Void> specifySchema(String schemaName)
specifySchema(String, Handler)
but returns a Future
of the asynchronous resultMySQLConnection getInternalStatistics(io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> handler)
handler
- the handler notified with the execution resultio.vertx.core.Future<String> getInternalStatistics()
getInternalStatistics(Handler)
but returns a Future
of the asynchronous resultMySQLConnection setOption(MySQLSetOption option, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
option
- the options to sethandler
- the handler notified with the execution resultio.vertx.core.Future<Void> setOption(MySQLSetOption option)
setOption(MySQLSetOption, Handler)
but returns a Future
of the asynchronous resultMySQLConnection resetConnection(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
handler
- the handler notified with the execution resultio.vertx.core.Future<Void> resetConnection()
resetConnection(Handler)
but returns a Future
of the asynchronous resultMySQLConnection debug(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
handler
- the handler notified with the execution resultio.vertx.core.Future<Void> debug()
debug(Handler)
but returns a Future
of the asynchronous resultMySQLConnection changeUser(MySQLAuthOptions options, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
options
- authentication optionshandler
- the handlerio.vertx.core.Future<Void> changeUser(MySQLAuthOptions options)
changeUser(MySQLAuthOptions, Handler)
but returns a Future
of the asynchronous resultstatic MySQLConnection cast(SqlConnection sqlConnection)
SqlConnection
to MySQLConnection
.
This is mostly useful for Vert.x generated APIs like RxJava/Mutiny.sqlConnection
- the connection to castinstance
Copyright © 2021 Eclipse. All rights reserved.