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

后端 未结 7 1181
梦谈多话
梦谈多话 2020-12-29 04:39

I am working on an application that streams ResultSet over a network. I ended up using a CachedRowSetImpl class. But when I connect to an Oracle DB, I get an error like this

相关标签:
7条回答
  • 2020-12-29 05:11

    This can be solved by using the timestampValue() function present in the oracle.sql.TIMESTAMP class. This method will convert oracle.sql.TIMESTAMP into java.sql.Timestamp.

    oracle.sql.TIMESTAMP ts = (oracle.sql.TIMESTAMP) res.getObject("last_update"); agent.setLastUpdate(ts.timestampValue());

    0 讨论(0)
提交回复
热议问题