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

后端 未结 7 1240
梦谈多话
梦谈多话 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 04:57

    Most likely you used getTIMESTAMP() instead of getTimestamp(). The methods getTIMESTAMP() (and getDATE() are extension in OracleResultSet which return Oracle specific types.

    If not then you are not using a JDBC driver, because the returntype of getDate() is java.sql.Date and of getTimestamp() is java.sql.Timestamp, so it can't be a totally different type as in your question.

提交回复
热议问题