1

I'm using mybatis in my web application.

I'm executing the below select query:

<select id="retrieveSearchResultReferrals" resultType="hashmap" parameterType="map">
    select *
    from 
        table(xxxx.test_abc_pk.retrieveDA(#{searchString}))
</select>

Of the columns in result some are DATE data type and one column is TIMESTAMP data type.

Mybatis is converting DATE column correctly to java.sql.Date BUT for the TIMESTAMP column it is converting it to oracle.sql.TIMESTAMP instead of java.sql.Timestamp.

Any ideas on how can I make mybatis to convert TIMESTAMP to java.sql.Timestamp?

Saggy
  • 624
  • 8
  • 23
tarares
  • 392
  • 4
  • 10
  • 27
  • how about jdbcType="TIMESTAMP", i read it somewhere long ago.! Ofcourse you have to set property for individual column. – Maheswaran Ravisankar Jan 27 '14 at 18:50
  • @MaheswaranRavisankar jdbcType="TIMESTAMP" can be used if I'm using resultMap and my custom Java object but here I'm using mybatis hashmap as resultType. I'm not sure how can I do a custom mapping in this case. – tarares Jan 27 '14 at 18:57
  • Did you find a solution for this? – user311174 Mar 22 '17 at 12:52

1 Answers1

1

Try setting property oracle.jdbc.J2EE13Compliant=true for your application.

See java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
kcala
  • 21
  • 2