diff --git a/doc/prepared-statements.md b/doc/prepared-statements.md index 5cc1e63..2ccf93a 100644 --- a/doc/prepared-statements.md +++ b/doc/prepared-statements.md @@ -32,13 +32,13 @@ This can be extended to any Clojure data type, to provide a customized way to ad ```clojure (extend-protocol p/SettableParameter java.time.Instant - (set-parameter [^java.time.Instant v ^PreparedStatement s ^long i] + (set-parameter [^java.time.Instant v ^PreparedStatement ps ^long i] (.setTimestamp ps i (java.sql.Timestamp/from v))) java.time.LocalDate - (set-parameter [^java.time.LocalDate v ^PreparedStatement s ^long i] + (set-parameter [^java.time.LocalDate v ^PreparedStatement ps ^long i] (.setTimestamp ps i (java.sql.Timestamp/valueOf (.atStartOfDay v)))) java.time.LocalDateTime - (set-parameter [^java.time.LocalDateTime v ^PreparedStatement s ^long i] + (set-parameter [^java.time.LocalDateTime v ^PreparedStatement ps ^long i] (.setTimestamp ps i (java.sql.Timestamp/valueOf v)))) ``` diff --git a/doc/result-set-builders.md b/doc/result-set-builders.md index 7307756..96ff13a 100644 --- a/doc/result-set-builders.md +++ b/doc/result-set-builders.md @@ -73,10 +73,15 @@ In addition, inside `plan`, as each value is looked up by name in the current st The default implementation of this protocol is for these two functions to return `nil` as `nil`, a `Boolean` value as a canonical `true` or `false` value (unfortunately, JDBC drivers cannot be relied on to return unique values here!), and for all other objects to be returned as-is. -`next.jdbc` makes no assumptions beyond `nil` and `Boolean`, but common extensions here could include converting `java.sql.Timestamp` to `java.time.Instant` for example: +`next.jdbc` makes no assumptions beyond `nil` and `Boolean`, but common extensions here could include converting `java.sql.Date` to `java.time.LocalDate` and `java.sql.Timestamp` to `java.time.Instant` for example: ```clojure (extend-protocol rs/ReadableColumn + java.sql.Date + (read-column-by-label ^java.time.LocalDate [^java.sql.Date v _] + (.toLocalDate v)) + (read-column-by-index ^java.time.LocalDate [^java.sql.Date v _2 _3] + (.toLocalDate v)) java.sql.Timestamp (read-column-by-label ^java.time.Instant [^java.sql.Timestamp v _] (.toInstant v))