more operations;
authorwenzelm
Sun Mar 19 13:47:07 2017 +0100 (2017-03-19)
changeset 653237f6c738379f4
parent 65322 b2dc9e3b8ee5
child 65324 1964d3cb2e57
more operations;
src/Pure/General/sql.scala
     1.1 --- a/src/Pure/General/sql.scala	Sun Mar 19 13:36:19 2017 +0100
     1.2 +++ b/src/Pure/General/sql.scala	Sun Mar 19 13:47:07 2017 +0100
     1.3 @@ -234,9 +234,17 @@
     1.4      }
     1.5      def date(rs: ResultSet, name: String): Date
     1.6  
     1.7 -    def get[A](rs: ResultSet, name: String, f: (ResultSet, String) => A): Option[A] =
     1.8 +    def bool(rs: ResultSet, column: Column): Boolean = bool(rs, column.name)
     1.9 +    def int(rs: ResultSet, column: Column): Int = int(rs, column.name)
    1.10 +    def long(rs: ResultSet, column: Column): Long = long(rs, column.name)
    1.11 +    def double(rs: ResultSet, column: Column): Double = double(rs, column.name)
    1.12 +    def string(rs: ResultSet, column: Column): String = string(rs, column.name)
    1.13 +    def bytes(rs: ResultSet, column: Column): Bytes = bytes(rs, column.name)
    1.14 +    def date(rs: ResultSet, column: Column): Date = date(rs, column.name)
    1.15 +
    1.16 +    def get[A, B](rs: ResultSet, a: A, f: (ResultSet, A) => B): Option[B] =
    1.17      {
    1.18 -      val x = f(rs, name)
    1.19 +      val x = f(rs, a)
    1.20        if (rs.wasNull) None else Some(x)
    1.21      }
    1.22