Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在这样做:
Select count(*) from table1 t where start_datetime = datetime(?);
使用以下方法设置日期时间:
ps.setString("01-01-2010 12:12:00.123")
它给出的错误为:日期时间或间隔中的非数字字符。
但是,如果我在 SQL 编辑器中将其作为 SQL 运行,则一切正常。
任何线索如何纠正这个?
更改字符串以符合默认datetime日期模式
datetime
ps.setString("2010-01-01 12:12:00.1230")
我认为这样的事情也应该有效
select count(*) from table1 t where start_datetime = TO_DATE(?,"%Y-%m-%d %H:%M:%S %F3")
让我知道