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 . |
Completable |
changeUser(MySQLAuthOptions options)
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 Single<MySQLConnection> |
connect(Vertx vertx,
MySQLConnectOptions connectOptions)
Create a connection to MySQL server with the given
connectOptions . |
static Single<MySQLConnection> |
connect(Vertx vertx,
String connectionUri)
Like
connect(io.vertx.rxjava3.core.Vertx, io.vertx.mysqlclient.MySQLConnectOptions) with options built from connectionUri . |
Completable |
debug()
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() |
Single<String> |
getInternalStatistics()
Send a STATISTICS command to get a human readable string of the server internal status.
|
int |
hashCode() |
static MySQLConnection |
newInstance(MySQLConnection arg) |
Completable |
ping()
Send a PING command to check if the server is alive.
|
Single<PreparedStatement> |
prepare(String sql)
Create a prepared statement using the given
sql string. |
Completable |
resetConnection()
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)
Like
connect(io.vertx.rxjava3.core.Vertx, io.vertx.mysqlclient.MySQLConnectOptions) with options built from 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.
|
Completable |
setOption(MySQLSetOption option)
Send a SET_OPTION command to set options for the current connection.
|
Completable |
specifySchema(String schemaName)
Send a INIT_DB command to change the default schema of the connection.
|
String |
toString() |
begin, close, databaseMetadata, isSSL, newInstance, prepare, rxBegin, rxClose, rxPrepare, transaction
newInstance, preparedQuery, 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 Single<MySQLConnection> 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 Single<MySQLConnection> connect(Vertx vertx, String connectionUri)
connect(io.vertx.rxjava3.core.Vertx, io.vertx.mysqlclient.MySQLConnectOptions)
with options built from connectionUri
.vertx
- connectionUri
- public static Single<MySQLConnection> rxConnect(Vertx vertx, String connectionUri)
connect(io.vertx.rxjava3.core.Vertx, io.vertx.mysqlclient.MySQLConnectOptions)
with options built from connectionUri
.vertx
- connectionUri
- public Single<PreparedStatement> 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 Completable ping()
public Completable rxPing()
public Completable specifySchema(String schemaName)
schemaName
- name of the schema to change topublic Completable rxSpecifySchema(String schemaName)
schemaName
- name of the schema to change topublic Single<String> getInternalStatistics()
public Single<String> rxGetInternalStatistics()
public Completable setOption(MySQLSetOption option)
option
- the options to setpublic Completable rxSetOption(MySQLSetOption option)
option
- the options to setpublic Completable resetConnection()
public Completable rxResetConnection()
public Completable debug()
public Completable rxDebug()
public Completable 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 © 2024 Eclipse. All rights reserved.