vertx-lang-scala-docs_2.12 3.8.0 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package ext
  Definition Classes
    scala
-  package sql
  Definition Classes
    ext
- ResultSet
- SQLClient
- SQLConnection
- SQLOperations
- SQLOptions
- SQLRowStream
- UpdateResult

c

io.vertx.scala.ext.sql

# SQLConnection 

###
Companion object SQLConnection

#### class SQLConnection extends SQLOperations

Represents a connection to a SQL database

Linear Supertypes
SQLOperations, AnyRef, Any
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. SQLConnection
2. SQLOperations
3. AnyRef
4. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new SQLConnection(_asJava: AnyRef)

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
5.  def asJava: AnyRef
   Definition Classes
     SQLConnection → SQLOperations
6.  def batch(sqlStatements: Buffer[String], handler: Handler[AsyncResult[Buffer[Int]]]): SQLConnection

   Batch simple SQL strings and execute the batch where the async result contains a array of Integers.

   Batch simple SQL strings and execute the batch where the async result contains a array of Integers. * @param sqlStatements sql statement

   handler

     the result handler

7.  def batchCallableWithParams(sqlStatement: String, inArgs: Buffer[JsonArray], outArgs: Buffer[JsonArray], handler: Handler[AsyncResult[Buffer[Int]]]): SQLConnection

   Batch a callable statement with all entries from the args list.

   Batch a callable statement with all entries from the args list. Each entry is a batch. The size of the lists inArgs and outArgs MUST be the equal. The operation completes with the execution of the batch where the async result contains a array of Integers. * @param sqlStatement sql statement

   inArgs

     the callable statement input arguments

   outArgs

     the callable statement output arguments

   handler

     the result handler

8.  def batchCallableWithParamsFuture(sqlStatement: String, inArgs: Buffer[JsonArray], outArgs: Buffer[JsonArray]): Future[Buffer[Int]]

   Like batchCallableWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

9.  def batchFuture(sqlStatements: Buffer[String]): Future[Buffer[Int]]

   Like batch but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

10.  def batchWithParams(sqlStatement: String, args: Buffer[JsonArray], handler: Handler[AsyncResult[Buffer[Int]]]): SQLConnection

    Batch a prepared statement with all entries from the args list.

    Batch a prepared statement with all entries from the args list. Each entry is a batch. The operation completes with the execution of the batch where the async result contains a array of Integers. * @param sqlStatement sql statement

    args

      the prepared statement arguments

    handler

      the result handler

11.  def batchWithParamsFuture(sqlStatement: String, args: Buffer[JsonArray]): Future[Buffer[Int]]

    Like batchWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

12.  def call(sql: String, resultHandler: Handler[AsyncResult[ResultSet]]): SQLConnection

    Calls the given SQL `PROCEDURE` which returns the result from the procedure.

    Calls the given SQL `PROCEDURE` which returns the result from the procedure. * @param sql the SQL to execute. For example `{call getEmpName``.

    resultHandler

      the handler which is called once the operation completes. It will return a `ResultSet`.

    Definition Classes
      SQLConnection → SQLOperations
13.  def callFuture(sql: String): Future[ResultSet]

    Like call but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like call but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
14.  def callWithParams(sql: String, params: JsonArray, outputs: JsonArray, resultHandler: Handler[AsyncResult[ResultSet]]): SQLConnection

    Calls the given SQL `PROCEDURE` which returns the result from the procedure.

    Calls the given SQL `PROCEDURE` which returns the result from the procedure.

    The index of params and outputs are important for both arrays, for example when dealing with a prodecure that takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:

          params = [VALUE1, VALUE2, null]
          outputs = [null, null, "VARCHAR"]

    * @param sql the SQL to execute. For example `{call getEmpName (?, ?)``.
    params

      these are the parameters to fill the statement.

    outputs

      these are the outputs to fill the statement.

    resultHandler

      the handler which is called once the operation completes. It will return a `ResultSet`.

    Definition Classes
      SQLConnection → SQLOperations
15.  def callWithParamsFuture(sql: String, params: JsonArray, outputs: JsonArray): Future[ResultSet]

    Like callWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like callWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
16.  def clone(): AnyRef
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @native() @throws( ... )
17.  def close(): Unit

    Closes the connection.

    Closes the connection. Important to always close the connection when you are done so it's returned to the pool.

18.  def close(handler: Handler[AsyncResult[Unit]]): Unit

    Closes the connection.

    Closes the connection. Important to always close the connection when you are done so it's returned to the pool. * @param handler the handler called when this operation completes.

19.  def closeFuture(): Future[Unit]

    Like close but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

20.  def commit(handler: Handler[AsyncResult[Unit]]): SQLConnection

    Commits all changes made since the previous commit/rollback.

    Commits all changes made since the previous commit/rollback. * @param handler the handler called when this operation completes.

21.  def commitFuture(): Future[Unit]

    Like commit but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

22.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
23.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
24.  def execute(sql: String, resultHandler: Handler[AsyncResult[Unit]]): SQLConnection

    Executes the given SQL statement * @param sql the SQL to execute.

    Executes the given SQL statement * @param sql the SQL to execute. For example `CREATE TABLE IF EXISTS table ...`

    resultHandler

      the handler which is called once this operation completes.

25.  def executeFuture(sql: String): Future[Unit]

    Like execute but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

26.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
27.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
28.  def getTransactionIsolation(handler: Handler[AsyncResult[TransactionIsolation]]): SQLConnection

    Attempts to return the transaction isolation level for this Connection object to the one given.

    Attempts to return the transaction isolation level for this Connection object to the one given. * @param handler the handler called when this operation completes.

29.  def getTransactionIsolationFuture(): Future[TransactionIsolation]

    Like getTransactionIsolation but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

30.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
31.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
32.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
33.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
34.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
35.  def query(sql: String, resultHandler: Handler[AsyncResult[ResultSet]]): SQLConnection

    Executes the given SQL `SELECT` statement which returns the results of the query.

    Executes the given SQL `SELECT` statement which returns the results of the query. * @param sql the SQL to execute. For example `SELECT * FROM table ...`.

    resultHandler

      the handler which is called once the operation completes. It will return a `ResultSet`.

    Definition Classes
      SQLConnection → SQLOperations
36.  def queryFuture(sql: String): Future[ResultSet]

    Like query but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like query but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
37.  def querySingle(sql: String, handler: Handler[AsyncResult[Option[JsonArray]]]): SQLOperations

    Execute a one shot SQL statement that returns a single SQL row.

    Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned. * @param sql the statement to execute

    handler

      the result handler

    returns

      self

    Definition Classes
      SQLConnection → SQLOperations
38.  def querySingleFuture(sql: String): Future[Option[JsonArray]]

    Like querySingle but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like querySingle but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
39.  def querySingleWithParams(sql: String, arguments: JsonArray, handler: Handler[AsyncResult[Option[JsonArray]]]): SQLOperations

    Execute a one shot SQL statement with arguments that returns a single SQL row.

    Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned. * @param sql the statement to execute

    arguments

      the arguments

    handler

      the result handler

    returns

      self

    Definition Classes
      SQLConnection → SQLOperations
40.  def querySingleWithParamsFuture(sql: String, arguments: JsonArray): Future[Option[JsonArray]]

    Like querySingleWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like querySingleWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
41.  def queryStream(sql: String, handler: Handler[AsyncResult[SQLRowStream]]): SQLConnection

    Executes the given SQL `SELECT` statement which returns the results of the query as a read stream.

    Executes the given SQL `SELECT` statement which returns the results of the query as a read stream. * @param sql the SQL to execute. For example `SELECT * FROM table ...`.

    handler

      the handler which is called once the operation completes. It will return a `SQLRowStream`.

    Definition Classes
      SQLConnection → SQLOperations
42.  def queryStreamFuture(sql: String): Future[SQLRowStream]

    Like queryStream but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like queryStream but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
43.  def queryStreamWithParams(sql: String, params: JsonArray, handler: Handler[AsyncResult[SQLRowStream]]): SQLConnection

    Executes the given SQL `SELECT` statement which returns the results of the query as a read stream.

    Executes the given SQL `SELECT` statement which returns the results of the query as a read stream. * @param sql the SQL to execute. For example `SELECT * FROM table ...`.

    params

      these are the parameters to fill the statement.

    handler

      the handler which is called once the operation completes. It will return a `SQLRowStream`.

    Definition Classes
      SQLConnection → SQLOperations
44.  def queryStreamWithParamsFuture(sql: String, params: JsonArray): Future[SQLRowStream]

    Like queryStreamWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like queryStreamWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
45.  def queryWithParams(sql: String, params: JsonArray, resultHandler: Handler[AsyncResult[ResultSet]]): SQLConnection

    Executes the given SQL `SELECT` prepared statement which returns the results of the query.

    Executes the given SQL `SELECT` prepared statement which returns the results of the query. * @param sql the SQL to execute. For example `SELECT * FROM table ...`.

    params

      these are the parameters to fill the statement.

    resultHandler

      the handler which is called once the operation completes. It will return a `ResultSet`.

    Definition Classes
      SQLConnection → SQLOperations
46.  def queryWithParamsFuture(sql: String, params: JsonArray): Future[ResultSet]

    Like queryWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like queryWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
47.  def rollback(handler: Handler[AsyncResult[Unit]]): SQLConnection

    Rolls back all changes made since the previous commit/rollback.

    Rolls back all changes made since the previous commit/rollback. * @param handler the handler called when this operation completes.

48.  def rollbackFuture(): Future[Unit]

    Like rollback but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

49.  def setAutoCommit(autoCommit: Boolean, resultHandler: Handler[AsyncResult[Unit]]): SQLConnection

    Sets the auto commit flag for this connection.

    Sets the auto commit flag for this connection. True by default. * @param autoCommit the autoCommit flag, true by default.

    resultHandler

      the handler which is called once this operation completes.

50.  def setAutoCommitFuture(autoCommit: Boolean): Future[Unit]

    Like setAutoCommit but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

51.  def setOptions(options: SQLOptions): SQLConnection

    Sets the desired options to be applied to the current connection when statements are executed.

    Sets the desired options to be applied to the current connection when statements are executed.

    The options are not applied globally but applicable to the current connection. For example changing the transaction isolation level will only affect statements run on this connection and not future or current connections acquired from the connection pool.

    This method is not async in nature since the apply will only happen at the moment a query is run. * @param options the options to modify the unwrapped connection. see SQLOptions

52.  def setQueryTimeout(timeoutInSeconds: Int): SQLConnection

    Sets a connection wide query timeout.

    Sets a connection wide query timeout.

    It can be over written at any time and becomes active on the next query call. * @param timeoutInSeconds the max amount of seconds the query can take to execute.

53.  def setTransactionIsolation(isolation: TransactionIsolation, handler: Handler[AsyncResult[Unit]]): SQLConnection

    Attempts to change the transaction isolation level for this Connection object to the one given.

    Attempts to change the transaction isolation level for this Connection object to the one given.

    The constants defined in the interface Connection are the possible transaction isolation levels. * @param isolation the level of isolation

    handler

      the handler called when this operation completes.

54.  def setTransactionIsolationFuture(isolation: TransactionIsolation): Future[Unit]

    Like setTransactionIsolation but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

55.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
56.  def toString(): String
    Definition Classes
      AnyRef → Any
57.  def update(sql: String, resultHandler: Handler[AsyncResult[UpdateResult]]): SQLConnection

    Executes the given SQL statement which may be an `INSERT`, `UPDATE`, or `DELETE` statement.

    Executes the given SQL statement which may be an `INSERT`, `UPDATE`, or `DELETE` statement. * @param sql the SQL to execute. For example `INSERT INTO table ...`

    resultHandler

      the handler which is called once the operation completes.

    Definition Classes
      SQLConnection → SQLOperations
58.  def updateFuture(sql: String): Future[UpdateResult]

    Like update but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like update but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
59.  def updateWithParams(sql: String, params: JsonArray, resultHandler: Handler[AsyncResult[UpdateResult]]): SQLConnection

    Executes the given prepared statement which may be an `INSERT`, `UPDATE`, or `DELETE` statement with the given parameters * @param sql the SQL to execute.

    Executes the given prepared statement which may be an `INSERT`, `UPDATE`, or `DELETE` statement with the given parameters * @param sql the SQL to execute. For example `INSERT INTO table ...`

    params

      these are the parameters to fill the statement.

    resultHandler

      the handler which is called once the operation completes.

    Definition Classes
      SQLConnection → SQLOperations
60.  def updateWithParamsFuture(sql: String, params: JsonArray): Future[UpdateResult]

    Like updateWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like updateWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
      SQLConnection → SQLOperations
61.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
62.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
63.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @native() @throws( ... )

### Inherited from SQLOperations

### Inherited from AnyRef

### Inherited from Any

### Ungrouped