11package com .simple .jdub
22
3- import org .joda .time .{DateTime , DateTimeZone }
3+ import org .joda .time .DateTime
4+ import org .joda .time .DateTimeZone
45
5- import java .io .{InputStream , Reader }
6+ import java .io .InputStream
7+ import java .io .Reader
68import java .net .URL
7- import java .sql .{Blob , Clob , Date , NClob , Ref , ResultSet , SQLXML , Time , Timestamp }
8- import java .time .{Instant , LocalDateTime }
9+ import java .sql .Blob
10+ import java .sql .Clob
11+ import java .sql .Date
12+ import java .sql .NClob
13+ import java .sql .Ref
14+ import java .sql .ResultSet
15+ import java .sql .SQLXML
16+ import java .sql .Time
17+ import java .sql .Timestamp
18+ import java .time .Instant
19+ import java .time .LocalDate
20+ import java .time .LocalDateTime
921import java .util .UUID
1022
1123/**
@@ -116,12 +128,12 @@ class Row(rs: ResultSet) {
116128 def bigDecimal (name : String ): Option [BigDecimal ] = extract(rs.getBigDecimal(name)).map { scala.math.BigDecimal (_) }
117129
118130 /**
119- * Extract the value at the given offset as an Option[Array[Byte]].
131+ * Extract the value at the given offset as an ` Option[Array[Byte]]` .
120132 */
121133 def bytes (index : Int ): Option [Array [Byte ]] = extract(rs.getBytes(index + 1 ))
122134
123135 /**
124- * Extract the value with the given name as an Option[Array[Byte]].
136+ * Extract the value with the given name as an ` Option[Array[Byte]]` .
125137 */
126138 def bytes (name : String ): Option [Array [Byte ]] = extract(rs.getBytes(name))
127139
@@ -143,7 +155,7 @@ class Row(rs: ResultSet) {
143155 /**
144156 * Extract the value with the given name as an Option[Time].
145157 */
146- def time (name : String ) = extract(rs.getTime(name))
158+ def time (name : String ): Option [ Time ] = extract(rs.getTime(name))
147159
148160 /**
149161 * Extract the value at the given offset as an Option[Timestamp].
@@ -175,6 +187,16 @@ class Row(rs: ResultSet) {
175187 */
176188 def localDateTime (name : String ): Option [LocalDateTime ] = timestamp(name).map(_.toLocalDateTime)
177189
190+ /**
191+ * Extract the value at the given offset as an Option[LocalDate].
192+ */
193+ def localDate (index : Int ): Option [LocalDate ] = localDateTime(index).map(_.toLocalDate)
194+
195+ /**
196+ * Extract the value with the given name as an Option[LocalDate].
197+ */
198+ def localDate (name : String ): Option [LocalDate ] = localDateTime(name).map(_.toLocalDate)
199+
178200 /**
179201 * Extract the value with the given name as an Option[DateTime].
180202 */
0 commit comments