Class SqlConnection
- All Implemented Interfaces:
MutinyDelegate
- Direct Known Subclasses:
DB2Connection,MSSQLConnection,MySQLConnection,OracleConnection,PgConnection
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Julien Viet, Emad Alblueshi
- See Also:
-
SqlConnection
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSqlConnection(io.vertx.sqlclient.SqlConnection delegate) Create a new instance ofSqlConnectiondelegating to the given (non-null) instance ofSqlConnection.SqlConnection(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Transaction>begin()Begin a transaction and returns aTransactionfor controlling and tracking this transaction.Begin a transaction and returns aTransactionfor controlling and tracking this transaction.Begin a transaction and returns aTransactionfor controlling and tracking this transaction.io.smallrye.mutiny.Uni<Void>close()Close the client and release the associated resources.voidClose the client and release the associated resources.Close the client and release the associated resources.closeHandler(Runnable handler) Set an handler called when the connection is closed.booleanexceptionHandler(Consumer<Throwable> handler) Set an handler called with connection errors.io.vertx.sqlclient.SqlConnectionGet the delegate instance.inthashCode()booleanisSSL()static SqlConnectionnewInstance(io.vertx.sqlclient.SqlConnection delegate) Creates a new instance of theSqlConnection.io.smallrye.mutiny.Uni<PreparedStatement>Create a prepared statement using the givensqlstring.io.smallrye.mutiny.Uni<PreparedStatement>Create a prepared statement using the givensqlstring.prepareAndAwait(String sql) Create a prepared statement using the givensqlstring.prepareAndAwait(String sql, io.vertx.sqlclient.PrepareOptions options) Create a prepared statement using the givensqlstring.prepareAndForget(String sql) Create a prepared statement using the givensqlstring.prepareAndForget(String sql, io.vertx.sqlclient.PrepareOptions options) Create a prepared statement using the givensqlstring.toString()Methods inherited from class io.vertx.mutiny.sqlclient.SqlClient
newInstance, preparedQuery, preparedQuery, query
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
SqlConnection
public SqlConnection(io.vertx.sqlclient.SqlConnection delegate) Create a new instance ofSqlConnectiondelegating to the given (non-null) instance ofSqlConnection. -
SqlConnection
-
-
Method Details
-
getDelegate
public io.vertx.sqlclient.SqlConnection getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Overrides:
getDelegatein classSqlClient- Returns:
- the delegate instance
-
prepare
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
sql- the sql- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SqlConnection.prepare(String)
-
prepareAndAwait
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method returns a
PreparedStatement. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
sql- the sql- Returns:
- The operation result
- See Also:
-
SqlConnection.prepare(String)
-
prepareAndForget
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method ignores the
PreparedStatementresult or any failure.- Parameters:
sql- the sql- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SqlConnection.prepare(String)
-
prepare
@CheckReturnValue public io.smallrye.mutiny.Uni<PreparedStatement> prepare(String sql, io.vertx.sqlclient.PrepareOptions options) Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
sql- the sql- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SqlConnection.prepare(String, PrepareOptions)
-
prepareAndAwait
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method returns a
PreparedStatement. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
sql- the sql- Returns:
- The operation result
- See Also:
-
SqlConnection.prepare(String, PrepareOptions)
-
prepareAndForget
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method ignores the
PreparedStatementresult or any failure.- Parameters:
sql- the sql- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SqlConnection.prepare(String, PrepareOptions)
-
begin
Begin a transaction and returns aTransactionfor controlling and tracking this transaction. When the connection is explicitely closed, any inflight transaction is rollbacked.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SqlConnection.begin()
-
beginAndAwait
Begin a transaction and returns aTransactionfor controlling and tracking this transaction. When the connection is explicitely closed, any inflight transaction is rollbacked.Unlike the bare Vert.x variant, this method returns a
Transaction. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Returns:
- The operation result
- See Also:
-
SqlConnection.begin()
-
beginAndForget
Begin a transaction and returns aTransactionfor controlling and tracking this transaction. When the connection is explicitely closed, any inflight transaction is rollbacked.Unlike the bare Vert.x variant, this method ignores the
Transactionresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SqlConnection.begin()
-
close
Close the client and release the associated resources.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
-
closeAndAwait
public void closeAndAwait()Close the client and release the associated resources.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Overrides:
closeAndAwaitin classSqlClient- See Also:
-
SqlClient.close()
-
closeAndForget
Close the client and release the associated resources.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Overrides:
closeAndForgetin classSqlClient- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SqlClient.close()
-
exceptionHandler
Set an handler called with connection errors.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
closeHandler
Set an handler called when the connection is closed.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
transaction
- Returns:
- the current transaction if it exists, otherwise null
-
isSSL
public boolean isSSL()- Returns:
- whether the connection uses SSL
-
databaseMetadata
- Returns:
- The static metadata about the backend database server for this connection
-
newInstance
Creates a new instance of theSqlConnection. -
hashCode
public int hashCode() -
equals
-
toString
-