JDBC: complains about invalid sign but seems fine

前端 未结 3 1469
[愿得一人]
[愿得一人] 2021-01-25 18:41

I have to use JDBC to write to a database (hibernate/ibatis is not an option) and my database is Oracle 11g.

I create the following query: insert into user(user_id

3条回答
  •  甜味超标
    2021-01-25 19:25

    TO_TIMESTAMP('14/12/2010 15/09/46', 'DD/MM/RR HH24/MI/SS')
    

    You send a 4-digit year but the format string defines a 2-digit year (no century)

    Give this a try:

    insertQuery.append("', 'DD/MM/RRRR HH24/MI/SS'));");
    

提交回复
热议问题