Package io.vertx.reactivex.sqlclient
Class SqlConnection
- java.lang.Object
-
- io.vertx.reactivex.sqlclient.SqlClient
-
- io.vertx.reactivex.sqlclient.SqlConnection
-
- Direct Known Subclasses:
DB2Connection
,JDBCConnection
,MSSQLConnection
,MySQLConnection
,OracleConnection
,PgConnection
public class SqlConnection extends SqlClient
A connection to the database server.NOTE: This class has been automatically generated from the
original
non RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<SqlConnection>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description SqlConnection(SqlConnection delegate)
SqlConnection(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<Transaction>
begin()
Begin a transaction and returns aTransaction
for controlling and tracking this transaction.SqlConnection
closeHandler(Handler<Void> handler)
Set an handler called when the connection is closed.DatabaseMetadata
databaseMetadata()
boolean
equals(Object o)
SqlConnection
exceptionHandler(Handler<Throwable> handler)
Set an handler called with connection errors.SqlConnection
getDelegate()
int
hashCode()
boolean
isSSL()
static SqlConnection
newInstance(SqlConnection arg)
Future<PreparedStatement>
prepare(String sql)
Create a prepared statement using the givensql
string.Future<PreparedStatement>
prepare(String sql, PrepareOptions options)
Create a prepared statement using the givensql
string.Single<Transaction>
rxBegin()
Begin a transaction and returns aTransaction
for controlling and tracking this transaction.Single<PreparedStatement>
rxPrepare(String sql)
Create a prepared statement using the givensql
string.Single<PreparedStatement>
rxPrepare(String sql, PrepareOptions options)
Create a prepared statement using the givensql
string.String
toString()
Transaction
transaction()
-
Methods inherited from class io.vertx.reactivex.sqlclient.SqlClient
close, newInstance, preparedQuery, preparedQuery, query, rxClose
-
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<SqlConnection> __TYPE_ARG
-
-
Constructor Detail
-
SqlConnection
public SqlConnection(SqlConnection delegate)
-
SqlConnection
public SqlConnection(Object delegate)
-
-
Method Detail
-
getDelegate
public SqlConnection getDelegate()
- Overrides:
getDelegate
in classSqlClient
-
prepare
public Future<PreparedStatement> prepare(String sql)
Create a prepared statement using the givensql
string.- Parameters:
sql
- the sql- Returns:
- a future notified with the prepared statement
-
rxPrepare
public Single<PreparedStatement> rxPrepare(String sql)
Create a prepared statement using the givensql
string.- Parameters:
sql
- the sql- Returns:
- a future notified with the prepared statement
-
prepare
public Future<PreparedStatement> prepare(String sql, PrepareOptions options)
Create a prepared statement using the givensql
string.- Parameters:
sql
- the sqloptions
-- Returns:
- a future notified with the prepared statement
-
rxPrepare
public Single<PreparedStatement> rxPrepare(String sql, PrepareOptions options)
Create a prepared statement using the givensql
string.- Parameters:
sql
- the sqloptions
-- Returns:
- a future notified with the prepared statement
-
exceptionHandler
public SqlConnection exceptionHandler(Handler<Throwable> handler)
Set an handler called with connection errors.- Parameters:
handler
- the handler- Returns:
- a reference to this, so the API can be used fluently
-
closeHandler
public SqlConnection closeHandler(Handler<Void> handler)
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
-
begin
public Future<Transaction> begin()
Begin a transaction and returns aTransaction
for controlling and tracking this transaction. When the connection is explicitely closed, any inflight transaction is rollbacked.- Returns:
- a future notified with the transactino
-
rxBegin
public Single<Transaction> rxBegin()
Begin a transaction and returns aTransaction
for controlling and tracking this transaction. When the connection is explicitely closed, any inflight transaction is rollbacked.- Returns:
- a future notified with the transactino
-
transaction
public Transaction transaction()
- Returns:
- the current transaction if it exists, otherwise null
-
isSSL
public boolean isSSL()
- Returns:
- whether the connection uses SSL
-
databaseMetadata
public DatabaseMetadata databaseMetadata()
- Returns:
- The static metadata about the backend database server for this connection
-
newInstance
public static SqlConnection newInstance(SqlConnection arg)
-
-