java.sql.SQLDataException: ORA-01861: literal does not match format string

Oracle Java About 180 words

字符串格式不匹配

原因

直接使用了查询条件2019-07-10 00:00:00,没有指定日期格式。

解决方法

使用to_date()、to_char()函数转换

select * from test where create_time > to_date('2019-07-10 00:00:00', 'YYYY-MM-DD HH24:MI:SS');
Views: 4,260 · Posted: 2019-07-10

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh