the oracle jdbc adapter returns a whole host of strange datatypes. for
instance, it returns bigdecimals for numbers you have mapped to be
numbers (with a precision, without a scale) in the table. it also
returns its own custom time classes. these generally have a toJdbc()
method to convert them to the 'expected' jdbc type.

a quick look under the covers of any other language's db libraries
(such as activerecord or sequel) shows a whole host of these annoying
conversions back and forth. to be honest, the lack of the conversion
in java.jdbc is great as i can decide what i want to convert / not
convert.

tldr oracle jdbc is shit :P

On Tue, Aug 23, 2011 at 8:54 PM, HiHeelHottie <hiheelhot...@gmail.com> wrote:
>
> Hey Sean,
>
> I really appreciate the quick response and your work with java.jdbc.
> Completely agree with you that it shouldn't automatically map out of
> the box. As a newbie to clojure and jdbc, do you have any advice on
> how I can get into resultset-seq* to do the mapping? I think it would
> be better not to have to map a BigDecimal to double after resultset-
> seq* returns a row.
>
> Are there any future plans to add a mapping api to resultset-seq or is
> the pattern just to chain any custom mappings after resultset-seq?
>
> On Aug 23, 9:41 pm, Sean Corfield <seancorfi...@gmail.com> wrote:
>> No, you'd have to do it yourself. Since not all BigDecimal values
>> would fit correctly in double, it would be dangerous for resultset-seq
>> to do it.
>>
>> I expect there are all sorts of JDBC data types that don't quite match
>> Clojure types but I don't think automatically mapping them would be a
>> good idea...
>>
>> Sean
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Aug 23, 2011 at 6:16 PM, HiHeelHottie <hiheelhot...@gmail.com> wrote:
>> > It looks like Oracle NUMBER types get mapped to BigDecimal in a result
>> > seq from clojure.java.jdbc. Is there an easy way to configure
>> > clojure.java.jdbc/ResultSet to map Oracle NUMBERS to doubles?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to