prepareStatement で 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));
dateToString メソッドは次のような値を返します: 2012-01-01 12:00:00
エラー:
[Oracle][ODBC][Ora]ORA-01861: literal does not match format string
ご意見をお聞かせください。