public class MySQLConnection extends SqlConnection
The connection object supports all the operations defined in the interface, in addition it provides MySQL utility command support:
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<MySQLConnection> |
__TYPE_ARG |
Constructor and Description |
---|
MySQLConnection(MySQLConnection delegate) |
MySQLConnection(Object delegate) |
Modifier and Type | Method and Description |
---|---|
static MySQLConnection |
cast(SqlConnection sqlConnection)
Cast a to
MySQLConnection . |
MySQLConnection |
changeUser(MySQLAuthOptions options)
Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.
|
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 void |
connect(Vertx vertx,
MySQLConnectOptions connectOptions)
Create a connection to MySQL server with the given
connectOptions . |
static void |
connect(Vertx vertx,
MySQLConnectOptions connectOptions,
Handler<AsyncResult<MySQLConnection>> handler)
Create a connection to MySQL server with the given
connectOptions . |
static void |
connect(Vertx vertx,
String connectionUri)
|
static void |
connect(Vertx vertx,
String connectionUri,
Handler<AsyncResult<MySQLConnection>> handler)
|
MySQLConnection |
debug()
Send a DEBUG command to dump debug information to the server's stdout.
|
MySQLConnection |
debug(Handler<AsyncResult<Void>> handler)
Send a DEBUG command to dump debug information to the server's stdout.
|
boolean |
equals(Object o) |
MySQLConnection |
exceptionHandler(Handler<Throwable> handler)
Set an handler called with connection errors.
|
MySQLConnection |
getDelegate() |
MySQLConnection |
getInternalStatistics()
Send a STATISTICS command to get a human readable string of the server internal status.
|
MySQLConnection |
getInternalStatistics(Handler<AsyncResult<String>> handler)
Send a STATISTICS command to get a human readable string of the server internal status.
|
int |
hashCode() |
static MySQLConnection |
newInstance(MySQLConnection arg) |
MySQLConnection |
ping()
Send a PING command to check if the server is alive.
|
MySQLConnection |
ping(Handler<AsyncResult<Void>> handler)
Send a PING command to check if the server is alive.
|
MySQLConnection |
prepare(String sql)
Create a prepared statement using the given
sql string. |
MySQLConnection |
prepare(String sql,
Handler<AsyncResult<PreparedStatement>> handler)
Create a prepared statement using the given
sql string. |
MySQLConnection |
resetConnection()
Send a RESET_CONNECTION command to reset the session state.
|
MySQLConnection |
resetConnection(Handler<AsyncResult<Void>> handler)
Send a RESET_CONNECTION command to reset the session state.
|
Completable |
rxChangeUser(MySQLAuthOptions options)
Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.
|
static Single<MySQLConnection> |
rxConnect(Vertx vertx,
MySQLConnectOptions connectOptions)
Create a connection to MySQL server with the given
connectOptions . |
static Single<MySQLConnection> |
rxConnect(Vertx vertx,
String connectionUri)
|
Completable |
rxDebug()
Send a DEBUG command to dump debug information to the server's stdout.
|
Single<String> |
rxGetInternalStatistics()
Send a STATISTICS command to get a human readable string of the server internal status.
|
Completable |
rxPing()
Send a PING command to check if the server is alive.
|
Single<PreparedStatement> |
rxPrepare(String sql)
Create a prepared statement using the given
sql string. |
Completable |
rxResetConnection()
Send a RESET_CONNECTION command to reset the session state.
|
Completable |
rxSetOption(MySQLSetOption option)
Send a SET_OPTION command to set options for the current connection.
|
Completable |
rxSpecifySchema(String schemaName)
Send a INIT_DB command to change the default schema of the connection.
|
MySQLConnection |
setOption(MySQLSetOption option)
Send a SET_OPTION command to set options for the current connection.
|
MySQLConnection |
setOption(MySQLSetOption option,
Handler<AsyncResult<Void>> handler)
Send a SET_OPTION command to set options for the current connection.
|
MySQLConnection |
specifySchema(String schemaName)
Send a INIT_DB command to change the default schema of the connection.
|
MySQLConnection |
specifySchema(String schemaName,
Handler<AsyncResult<Void>> handler)
Send a INIT_DB command to change the default schema of the connection.
|
String |
toString() |
begin, begin, close, close, databaseMetadata, isSSL, newInstance, rxBegin, rxClose
newInstance, preparedQuery, query
public static final io.vertx.lang.rx.TypeArg<MySQLConnection> __TYPE_ARG
public MySQLConnection(MySQLConnection delegate)
public MySQLConnection(Object delegate)
public String toString()
toString
in class SqlConnection
public boolean equals(Object o)
equals
in class SqlConnection
public int hashCode()
hashCode
in class SqlConnection
public MySQLConnection getDelegate()
getDelegate
in class SqlConnection
public static 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 failurepublic static void connect(Vertx vertx, MySQLConnectOptions connectOptions)
connectOptions
.vertx
- the vertx instanceconnectOptions
- the options for the connectionpublic static Single<MySQLConnection> rxConnect(Vertx vertx, MySQLConnectOptions connectOptions)
connectOptions
.vertx
- the vertx instanceconnectOptions
- the options for the connectionpublic static void connect(Vertx vertx, String connectionUri, Handler<AsyncResult<MySQLConnection>> handler)
connect(io.vertx.reactivex.core.Vertx, io.vertx.mysqlclient.MySQLConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.mysqlclient.MySQLConnection>>)
with options built from connectionUri
.vertx
- connectionUri
- handler
- public static void connect(Vertx vertx, String connectionUri)
connect(io.vertx.reactivex.core.Vertx, io.vertx.mysqlclient.MySQLConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.mysqlclient.MySQLConnection>>)
with options built from connectionUri
.vertx
- connectionUri
- public static Single<MySQLConnection> rxConnect(Vertx vertx, String connectionUri)
connect(io.vertx.reactivex.core.Vertx, io.vertx.mysqlclient.MySQLConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.mysqlclient.MySQLConnection>>)
with options built from connectionUri
.vertx
- connectionUri
- public MySQLConnection prepare(String sql, Handler<AsyncResult<PreparedStatement>> handler)
SqlConnection
sql
string.prepare
in class SqlConnection
sql
- handler
- public MySQLConnection prepare(String sql)
SqlConnection
sql
string.prepare
in class SqlConnection
sql
- public Single<PreparedStatement> rxPrepare(String sql)
SqlConnection
sql
string.rxPrepare
in class SqlConnection
sql
- public MySQLConnection exceptionHandler(Handler<Throwable> handler)
SqlConnection
exceptionHandler
in class SqlConnection
handler
- public MySQLConnection closeHandler(Handler<Void> handler)
SqlConnection
closeHandler
in class SqlConnection
handler
- public MySQLConnection ping(Handler<AsyncResult<Void>> handler)
handler
- the handler notified when the server responses to clientpublic MySQLConnection ping()
public Completable rxPing()
public MySQLConnection specifySchema(String schemaName, Handler<AsyncResult<Void>> handler)
schemaName
- name of the schema to change tohandler
- the handler notified with the execution resultpublic MySQLConnection specifySchema(String schemaName)
schemaName
- name of the schema to change topublic Completable rxSpecifySchema(String schemaName)
schemaName
- name of the schema to change topublic MySQLConnection getInternalStatistics(Handler<AsyncResult<String>> handler)
handler
- the handler notified with the execution resultpublic MySQLConnection getInternalStatistics()
public Single<String> rxGetInternalStatistics()
public MySQLConnection setOption(MySQLSetOption option, Handler<AsyncResult<Void>> handler)
option
- the options to sethandler
- the handler notified with the execution resultpublic MySQLConnection setOption(MySQLSetOption option)
option
- the options to setpublic Completable rxSetOption(MySQLSetOption option)
option
- the options to setpublic MySQLConnection resetConnection(Handler<AsyncResult<Void>> handler)
handler
- the handler notified with the execution resultpublic MySQLConnection resetConnection()
public Completable rxResetConnection()
public MySQLConnection debug(Handler<AsyncResult<Void>> handler)
handler
- the handler notified with the execution resultpublic MySQLConnection debug()
public Completable rxDebug()
public MySQLConnection changeUser(MySQLAuthOptions options, Handler<AsyncResult<Void>> handler)
options
- authentication optionshandler
- the handlerpublic MySQLConnection changeUser(MySQLAuthOptions options)
options
- authentication optionspublic Completable rxChangeUser(MySQLAuthOptions options)
options
- authentication optionspublic static MySQLConnection cast(SqlConnection sqlConnection)
MySQLConnection
.
This is mostly useful for Vert.x generated APIs like RxJava/Mutiny.sqlConnection
- the connection to castinstance
public static MySQLConnection newInstance(MySQLConnection arg)
Copyright © 2021 Eclipse. All rights reserved.