trait SQLOperations extends AnyRef
Represents a SQL query interface to a database
- Alphabetic
- By Inheritance
- SQLOperations
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
- abstract def asJava: AnyRef
-
abstract
def
call(sql: String, resultHandler: Handler[AsyncResult[ResultSet]]): SQLOperations
Calls the given SQL
PROCEDURE
which returns the result from the procedure.Calls the given SQL
PROCEDURE
which returns the result from the procedure.- sql
the SQL to execute. For example
{call getEmpName`
.- resultHandler
the handler which is called once the operation completes. It will return a
ResultSet
.
-
abstract
def
callFuture(sql: String): Future[ResultSet]
Like call but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
abstract
def
callWithParams(sql: String, params: JsonArray, outputs: JsonArray, resultHandler: Handler[AsyncResult[ResultSet]]): SQLOperations
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"]
- 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
.
-
abstract
def
callWithParamsFuture(sql: String, params: JsonArray, outputs: JsonArray): Future[ResultSet]
Like callWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
abstract
def
query(sql: String, resultHandler: Handler[AsyncResult[ResultSet]]): SQLOperations
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.- 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
.
-
abstract
def
queryFuture(sql: String): Future[ResultSet]
Like query but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
abstract
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.
- sql
the statement to execute
- handler
the result handler
- returns
self
-
abstract
def
querySingleFuture(sql: String): Future[Option[JsonArray]]
Like querySingle but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
abstract
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.
- sql
the statement to execute
- arguments
the arguments
- handler
the result handler
- returns
self
-
abstract
def
querySingleWithParamsFuture(sql: String, arguments: JsonArray): Future[Option[JsonArray]]
Like querySingleWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
abstract
def
queryWithParams(sql: String, params: JsonArray, resultHandler: Handler[AsyncResult[ResultSet]]): SQLOperations
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.- 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
.
-
abstract
def
queryWithParamsFuture(sql: String, params: JsonArray): Future[ResultSet]
Like queryWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
abstract
def
update(sql: String, resultHandler: Handler[AsyncResult[UpdateResult]]): SQLOperations
Executes the given SQL statement which may be an
INSERT
,UPDATE
, orDELETE
statement.Executes the given SQL statement which may be an
INSERT
,UPDATE
, orDELETE
statement.- sql
the SQL to execute. For example
INSERT INTO table ...
- resultHandler
the handler which is called once the operation completes.
-
abstract
def
updateFuture(sql: String): Future[UpdateResult]
Like update but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
abstract
def
updateWithParams(sql: String, params: JsonArray, resultHandler: Handler[AsyncResult[UpdateResult]]): SQLOperations
Executes the given prepared statement which may be an
INSERT
,UPDATE
, orDELETE
statement with the given parametersExecutes the given prepared statement which may be an
INSERT
,UPDATE
, orDELETE
statement with the given parameters- 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.
-
abstract
def
updateWithParamsFuture(sql: String, params: JsonArray): Future[UpdateResult]
Like updateWithParams but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )