StatementMethods

final implicit
class StatementMethods(statement: Statement) extends AnyVal

Provides extension methods for java.sql.Statement.

See also

PreparedStatementMethods

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def execute[T](sql: String)(f: Execution => T): T

Executes SQL and passes Execution to supplied function.

Executes SQL and passes Execution to supplied function.

Value Params
f

function

sql

SQL statement

def first[T](sql: String)(f: ResultSet => T): Option[T]

Executes query and maps first row of ResultSet using supplied function.

Executes query and maps first row of ResultSet using supplied function.

If the result set is not empty, and if the supplied function's return value is not null, then Some value is returned; otherwise, None is returned.

Value Params
f

function

sql

SQL query

def flatMap[T](sql: String)(f: ResultSet => Iterable[T]): Seq[T]

Executes query and builds a collection using the elements mapped from each row of ResultSet.

Executes query and builds a collection using the elements mapped from each row of ResultSet.

Value Params
f

map function

params

parameters

sql

SQL query

def foreach(sql: String)(f: ResultSet => Unit): Unit

Executes query and invokes supplied function for each row of ResultSet.

Executes query and invokes supplied function for each row of ResultSet.

Value Params
f

function

sql

SQL query

def map[T](sql: String)(f: ResultSet => T): Seq[T]

Executes query and maps each row of ResultSet using supplied function.

Executes query and maps each row of ResultSet using supplied function.

Value Params
f

map function

params

parameters

sql

SQL query

def query[T](sql: String)(f: ResultSet => T): T

Executes query and passes ResultSet to supplied function.

Executes query and passes ResultSet to supplied function.

Value Params
f

function

sql

SQL query