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. |
Future<Void> |
changeUser(MySQLAuthOptions options)
Like
changeUser(MySQLAuthOptions, Handler) but returns a Future of the asynchronous result |
MySQLConnection |
changeUser(MySQLAuthOptions options,
Handler<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(Handler<Void> handler)
Set an handler called when the connection is closed.
|
static Future<MySQLConnection> |
connect(Vertx vertx,
MySQLConnectOptions connectOptions)
Like
connect(Vertx, MySQLConnectOptions, Handler) but returns a Future of the asynchronous result |
static void |
connect(Vertx vertx,
MySQLConnectOptions connectOptions,
Handler<AsyncResult<MySQLConnection>> handler)
Create a connection to MySQL server with the given
connectOptions. |
static Future<MySQLConnection> |
connect(Vertx vertx,
String connectionUri)
Like
connect(Vertx, String, Handler) but returns a Future of the asynchronous result |
static void |
connect(Vertx vertx,
String connectionUri,
Handler<AsyncResult<MySQLConnection>> handler)
Like
connect(Vertx, MySQLConnectOptions, Handler) with options built from connectionUri. |
Future<Void> |
debug()
Like
debug(Handler) but returns a Future of the asynchronous result |
MySQLConnection |
debug(Handler<AsyncResult<Void>> handler)
Send a DEBUG command to dump debug information to the server's stdout.
|
MySQLConnection |
exceptionHandler(Handler<Throwable> handler)
Set an handler called with connection errors.
|
Future<String> |
getInternalStatistics()
Like
getInternalStatistics(Handler) but returns a Future of the asynchronous result |
MySQLConnection |
getInternalStatistics(Handler<AsyncResult<String>> handler)
Send a STATISTICS command to get a human readable string of the server internal status.
|
Future<Void> |
ping()
Like
ping(Handler) but returns a Future of the asynchronous result |
MySQLConnection |
ping(Handler<AsyncResult<Void>> handler)
Send a PING command to check if the server is alive.
|
MySQLConnection |
prepare(String sql,
Handler<AsyncResult<PreparedStatement>> handler)
Create a prepared statement using the given
sql string. |
Future<Void> |
resetConnection()
Like
resetConnection(Handler) but returns a Future of the asynchronous result |
MySQLConnection |
resetConnection(Handler<AsyncResult<Void>> handler)
Send a RESET_CONNECTION command to reset the session state.
|
Future<Void> |
setOption(MySQLSetOption option)
Like
setOption(MySQLSetOption, Handler) but returns a Future of the asynchronous result |
MySQLConnection |
setOption(MySQLSetOption option,
Handler<AsyncResult<Void>> handler)
Send a SET_OPTION command to set options for the current connection.
|
Future<Void> |
specifySchema(String schemaName)
Like
specifySchema(String, Handler) but returns a Future of the asynchronous result |
MySQLConnection |
specifySchema(String schemaName,
Handler<AsyncResult<Void>> handler)
Send a INIT_DB command to change the default schema of the connection.
|
begin, begin, close, databaseMetadata, isSSL, prepare, prepare, prepareclose, preparedQuery, preparedQuery, querystatic void connect(Vertx vertx, MySQLConnectOptions connectOptions, Handler<AsyncResult<MySQLConnection>> handler)
connectOptions.vertx - the vertx instanceconnectOptions - the options for the connectionhandler - the handler called with the connection or the failurestatic Future<MySQLConnection> connect(Vertx vertx, MySQLConnectOptions connectOptions)
connect(Vertx, MySQLConnectOptions, Handler) but returns a Future of the asynchronous resultstatic void connect(Vertx vertx, String connectionUri, Handler<AsyncResult<MySQLConnection>> handler)
connect(Vertx, MySQLConnectOptions, Handler) with options built from connectionUri.static Future<MySQLConnection> connect(Vertx vertx, String connectionUri)
connect(Vertx, String, Handler) but returns a Future of the asynchronous resultMySQLConnection prepare(String sql, Handler<AsyncResult<PreparedStatement>> handler)
sql string.prepare in interface SqlConnectionsql - the sqlhandler - the handler notified with the prepared query asynchronouslyMySQLConnection exceptionHandler(Handler<Throwable> handler)
exceptionHandler in interface SqlConnectionhandler - the handlerMySQLConnection closeHandler(Handler<Void> handler)
closeHandler in interface SqlConnectionhandler - the handlerMySQLConnection ping(Handler<AsyncResult<Void>> handler)
handler - the handler notified when the server responses to clientFuture<Void> ping()
ping(Handler) but returns a Future of the asynchronous resultMySQLConnection specifySchema(String schemaName, Handler<AsyncResult<Void>> handler)
schemaName - name of the schema to change tohandler - the handler notified with the execution resultFuture<Void> specifySchema(String schemaName)
specifySchema(String, Handler) but returns a Future of the asynchronous resultMySQLConnection getInternalStatistics(Handler<AsyncResult<String>> handler)
handler - the handler notified with the execution resultFuture<String> getInternalStatistics()
getInternalStatistics(Handler) but returns a Future of the asynchronous resultMySQLConnection setOption(MySQLSetOption option, Handler<AsyncResult<Void>> handler)
option - the options to sethandler - the handler notified with the execution resultFuture<Void> setOption(MySQLSetOption option)
setOption(MySQLSetOption, Handler) but returns a Future of the asynchronous resultMySQLConnection resetConnection(Handler<AsyncResult<Void>> handler)
handler - the handler notified with the execution resultFuture<Void> resetConnection()
resetConnection(Handler) but returns a Future of the asynchronous resultMySQLConnection debug(Handler<AsyncResult<Void>> handler)
handler - the handler notified with the execution resultFuture<Void> debug()
debug(Handler) but returns a Future of the asynchronous resultMySQLConnection changeUser(MySQLAuthOptions options, Handler<AsyncResult<Void>> handler)
options - authentication optionshandler - the handlerFuture<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 castinstanceCopyright © 2022 Eclipse. All rights reserved.