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 Details

    • prepare

      Create a prepared statement using the given sql 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 given sql 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

      Begin a transaction and returns a Transaction 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