tarares
tarares

Reputation: 402

Oracle TIMESTAMP and Mybatis issue

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?

Upvotes: 1

Views: 4440

Answers (1)

kcala
kcala

Reputation: 21

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

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

Upvotes: 1

Related Questions