ResultSetMethods

final implicit class ResultSetMethods(resultSet: ResultSet) extends AnyVal

Provides extension methods for java.sql.ResultSet.

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

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

Maps remaining rows of ResultSet building a collection using elements returned from map function.

Maps remaining rows of ResultSet building a collection using elements returned from map function.

Value parameters:
f

map function

def fold[T](init: T)(op: (T, ResultSet) => T): T

Folds remaining rows of ResultSet to single value using given initial value and binary operator.

Folds remaining rows of ResultSet to single value using given initial value and binary operator.

Value parameters:
init

initial value

op

binary operator

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

Invokes supplied function for each remaining row of ResultSet.

Invokes supplied function for each remaining row of ResultSet.

Value parameters:
f

function

def get[T](index: Int)(using getValue: GetValueByIndex[T]): T

Gets column value in current row.

Gets column value in current row.

Type parameters:
T

type of value to return

Value parameters:
index

column index

def get[T](label: String)(using getValue: GetValueByLabel[T]): T

Gets column value in current row.

Gets column value in current row.

Type parameters:
T

type of value to return

Value parameters:
label

column label

def getColumnCount(): Int

Gets column count.

Gets column count.

def getColumnLabels(): Seq[String]

Gets column labels.

Gets column labels.

def getInstant(index: Int): Instant

Gets column value as Instant.

Gets column value as Instant.

def getInstant(label: String): Instant

Gets column value as Instant.

Gets column value as Instant.

def getLocalDate(index: Int): LocalDate

Gets column value as LocalDate.

Gets column value as LocalDate.

def getLocalDate(label: String): LocalDate

Gets column value as LocalDate.

Gets column value as LocalDate.

def getLocalDateTime(index: Int): LocalDateTime

Gets column value as LocalDateTime.

Gets column value as LocalDateTime.

def getLocalDateTime(label: String): LocalDateTime

Gets column value as LocalDateTime.

Gets column value as LocalDateTime.

def getLocalTime(index: Int): LocalTime

Gets column value as LocalTime.

Gets column value as LocalTime.

def getLocalTime(label: String): LocalTime

Gets column value as LocalTime.

Gets column value as LocalTime.

def getOption[T](index: Int)(using getValue: GetValueByIndex[T]): Option[T]

Gets column value in current row if value is not null.

Gets column value in current row if value is not null.

Type parameters:
T

type of value to return

Value parameters:
index

column index

def getOption[T](label: String)(using getValue: GetValueByLabel[T]): Option[T]

Gets column value in current row if value is not null.

Gets column value in current row if value is not null.

Type parameters:
T

type of value to return

Value parameters:
label

column label

def getOrElse[T](index: Int, default: => T)(using getValue: GetValueByIndex[T]): T

Gets column value in current row, or returns default if value is null.

Gets column value in current row, or returns default if value is null.

Type parameters:
T

type of value to return

Value parameters:
default

default value

index

column index

def getOrElse[T](label: String, default: => T)(using getValue: GetValueByLabel[T]): T

Gets column value in current row, or returns default if value is null.

Gets column value in current row, or returns default if value is null.

Type parameters:
T

type of value to return

Value parameters:
default

default value

label

column label

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

Maps remaining rows of ResultSet using supplied function.

Maps remaining rows of ResultSet using supplied function.

Value parameters:
f

map function

def next[T](f: ResultSet => T): Option[T]

Maps next row of ResultSet using supplied function.

Maps next row of ResultSet using supplied function.

If the result set has another row, 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