Passing null values in parameters, part 2 )

From: Evgeny Ryabitskiy (evgeny.ryabitski..mail.com)
Date: Mon Sep 28 2009 - 10:58:53 EDT

  • Next message: Robert Zeigler: "Re: Making sense of callbacks"

    Hello to everyone!

    After previous fix I can pass null values in parameters to SQLTemplates.
    It's working and it's cool!

    Now I have one more issue... :

    Here is query (very simple.. to focus on this issue, that I can't
    avoid by changing SQL or add directives like #bind or #result)

    SELECT isnull(#bind($MyNumericColumn), AnotherNumericColumn) AS
    MyColumn FROM MyTable

    If I pass some not null Decimal value it's working properly and
    returns BigDecimal value.

    But if I pass null or not pass anything.. it's still working! but
    return type is java.lang.String .. course null now has special JDBC
    type for it and JDBC converts my Numeric to String.

    I have only one idea: pass JDBC type with my null in parameters
    (like special class "JDBCTypedNull" with constructor and pass there
    JDBC type or value type and map it to JDBC).

    Any other suggestions?

    Best regards,
     Evgeny Ryabitskiy.



    This archive was generated by hypermail 2.0.0 : Mon Sep 28 2009 - 10:59:10 EDT