PreparedStatementMethods

final implicit class PreparedStatementMethods(statement: PreparedStatement) extends AnyVal

Provides extension methods for java.sql.PreparedStatement.

See also:

StatementMethods

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def addBatch(params: Seq[InParam]): Unit

Adds parameters to batch of commands.

Adds parameters to batch of commands.

Value parameters:
params

parameters

def execute[T](params: Seq[InParam])(f: Execution => T): T

Executes statement with parameters and passes Execution to supplied function.

Executes statement with parameters and passes Execution to supplied function.

Value parameters:
f

function

params

parameters

def first[T](params: Seq[InParam])(f: ResultSet => T): Option[T]

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

Executes query with parameters 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 parameters:
f

map function

params

parameters

def flatMap[T](params: Seq[InParam])(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 parameters:
f

map function

params

parameters

def foreach(params: Seq[InParam])(f: ResultSet => Unit): Unit

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

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

Value parameters:
f

function

params

parameters

def map[T](params: Seq[InParam])(f: ResultSet => T): Seq[T]

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

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

Value parameters:
f

map function

params

parameters

def query[T](params: Seq[InParam])(f: ResultSet => T): T

Executes query with parameters and passes ResultSet to supplied function.

Executes query with parameters and passes ResultSet to supplied function.

Value parameters:
f

function

params

parameters

def set(index: Int, value: InParam): Unit

Sets parameter at index to given value.

Sets parameter at index to given value.

Value parameters:
index

parameter index

value

parameter value

def set(params: Seq[InParam]): Unit

Sets parameters.

Sets parameters.

Value parameters:
index

parameter index

value

parameter value

def setInstant(index: Int, value: Instant): Unit

Sets parameter to given Instant.

Sets parameter to given Instant.

Value parameters:
index

parameter index

value

parameter value

def setLocalDate(index: Int, value: LocalDate): Unit

Sets parameter to given LocalDate.

Sets parameter to given LocalDate.

Value parameters:
index

parameter index

value

parameter value

def setLocalDateTime(index: Int, value: LocalDateTime): Unit

Sets parameter to given LocalDateTime.

Sets parameter to given LocalDateTime.

Value parameters:
index

parameter index

value

parameter value

def setLocalTime(index: Int, value: LocalTime): Unit

Sets parameter to given LocalTime.

Sets parameter to given LocalTime.

Value parameters:
index

parameter index

value

parameter value

def update(params: Seq[InParam]): Int

Executes update with parameters and returns update count.

Executes update with parameters and returns update count.

Value parameters:
params

parameters