Package io.vertx.sqlclient
Interface SqlConnection
-
- All Superinterfaces:
SqlClient
- All Known Subinterfaces:
DB2Connection
,JDBCConnection
,MSSQLConnection
,MySQLConnection
,OracleConnection
,PgConnection
public interface SqlConnection extends SqlClient
A connection to the database server.- Author:
- Julien Viet, Emad Alblueshi
-
-
Method Summary
All Methods Instance Methods Abstract 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()
SqlConnection
exceptionHandler(Handler<Throwable> handler)
Set an handler called with connection errors.boolean
isSSL()
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.Transaction
transaction()
-
Methods inherited from interface io.vertx.sqlclient.SqlClient
close, preparedQuery, preparedQuery, query
-
-
-
-
Method Detail
-
prepare
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
-
prepare
Future<PreparedStatement> prepare(String sql, PrepareOptions options)
Create a prepared statement using the givensql
string.- Parameters:
sql
- the sql- Returns:
- a future notified with the prepared statement
-
exceptionHandler
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
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
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
-
transaction
Transaction transaction()
- Returns:
- the current transaction if it exists, otherwise null
-
isSSL
boolean isSSL()
- Returns:
- whether the connection uses SSL
-
databaseMetadata
DatabaseMetadata databaseMetadata()
- Returns:
- The static metadata about the backend database server for this connection
-
-