Interface SqlConnection
- All Superinterfaces:
SqlClient
- All Known Subinterfaces:
DB2Connection, JDBCConnection, MSSQLConnection, MySQLConnection, OracleConnection, PgConnection
A connection to the database server.
- Author:
- Julien Viet, Emad Alblueshi
-
Method Summary
Modifier and TypeMethodDescriptionbegin()Begin a transaction and returns aTransactionfor controlling and tracking this transaction.closeHandler(Handler<Void> handler) Set an handler called when the connection is closed.exceptionHandler(Handler<Throwable> handler) Set an handler called with connection errors.booleanisSSL()Create a prepared statement using the givensqlstring.prepare(String sql, PrepareOptions options) Create a prepared statement using the givensqlstring.Methods inherited from interface SqlClient
close, preparedQuery, preparedQuery, query
-
Method Details
-
prepare
Create a prepared statement using the givensqlstring.- Parameters:
sql- the sql- Returns:
- a future notified with the prepared statement
-
prepare
Create a prepared statement using the givensqlstring.- Parameters:
sql- the sql- Returns:
- a future notified with the prepared statement
-
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
-
begin
Future<Transaction> begin()Begin a transaction and returns aTransactionfor 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
-