Class: SqlConnection

vertx-sql-client-js/sql_connection~ SqlConnection

new SqlConnection()

A connection to database server.
Source:

Methods

begin() → {Transaction}

Begin a transaction and returns a Transaction for controlling and tracking this transaction.

When the connection is explicitely closed, any inflight transaction is rollbacked.

Source:
Returns:
the transaction instance
Type
Transaction

close()

Close the current connection after all the pending commands have been processed.
Source:

closeHandler(handler) → {SqlConnection}

Set an handler called when the connection is closed.
Parameters:
Name Type Description
handler function the handler
Source:
Returns:
a reference to this, so the API can be used fluently
Type
SqlConnection

exceptionHandler(handler) → {SqlConnection}

Set an handler called with connection errors.
Parameters:
Name Type Description
handler function the handler
Source:
Returns:
a reference to this, so the API can be used fluently
Type
SqlConnection

isSSL() → {boolean}

Source:
Returns:
whether the connection uses SSL
Type
boolean

prepare(sql, handler) → {SqlConnection}

Create a prepared query.
Parameters:
Name Type Description
sql string the sql
handler function the handler notified with the prepared query asynchronously
Source:
Returns:
Type
SqlConnection

preparedBatch(sql, batch, handler) → {SqlConnection}

Parameters:
Name Type Description
sql string
batch Array.<Tuple>
handler function
Source:
Returns:
Type
SqlConnection

preparedQuery(sql, arguments, handler) → {SqlConnection}

Parameters:
Name Type Description
sql string
arguments Tuple
handler function
Source:
Returns:
Type
SqlConnection

query(sql, handler) → {SqlConnection}

Parameters:
Name Type Description
sql string
handler function
Source:
Returns:
Type
SqlConnection