Nel*_*elo 6 java oracle jdbc prepared-statement
我试图在preparedStatement中使用to_date在oracle数据库中输入日期,但是我收到错误.
代码片段:
sql = "select Identifier from metadata where content_cdate >=to_date(?,'dd-mm-yyyy') and content_cdate < to_date(?,'dd-mm-yyyy') and status='published' and content_mdate is null";
ps.setString(1, commonUtil.dateToString(startTime));
Run Code Online (Sandbox Code Playgroud)
dateToString方法返回如下值:2012-01-01 12:00:00
错误:
[Oracle][ODBC][Ora]ORA-01861: literal does not match format string
Run Code Online (Sandbox Code Playgroud)
请指教.
| 归档时间: |
|
| 查看次数: |
12805 次 |
| 最近记录: |