#26 There's no mapping for Oracle's DATE type.


given test case:

<test name="date">
<stmt>select sysdate from dual</stmt>
<result echo="true">

breaks down with message:

Setting up test...
At ${result[1,1,1]}, could not convert
java.sql.Timestamp returned from database to DATE(91)
Tearing down test...


  • Sujit Pal

    Sujit Pal - 2006-06-14

    Logged In: YES

    So it looks like Oracle.DATE needs to be mapped to
    javax.sql.Timestamp, which is currently mapped to
    TimestampType. You can make the addition in the
    types.properties yourself and it should just work (check the
    user guide for how to do it).

    I will also put this in this weekend and check in to CVS (if
    I have time, which looks unlikely at the moment, else
    sometime next week).


  • Nobody/Anonymous

    Logged In: NO

    How to map the java.date to oracle date type.

  • Nobody/Anonymous

    Logged In: NO

    The message is saying that sysdate is being returned from
    the database as java.sql.Timestamp and is being treated by
    SQLUnit as a java.sql.Date, based on the mapping in etc/

    I notice that the mapping is already there per CVS revision
    1.3 of types.properties. I suspect that the vendor name is
    something other than oracle. If the database vendor name
    (from Connection.getMetaData().getVendorName()) is other
    than oracle, then we will need to add a mapping for that.

    Another workaround is to explicitly specify a vendor name
    in the connection which does not have an explicit mapping,
    so DATE would map to the default mapping java.sql.Date.

    Please check to see the vendor name and let me know so I
    can add the mapping. If it is "oracle", this bug has
    already been fixed.


Log in to post a comment.