【发布时间】:2012-10-26 04:38:27
【问题描述】:
嗨,我有一列(输入日期)。我想插入自定义日期和时间而不使用 Preparedstatement。我已经使用过
String date = sf.format(Calendar.getInstance().getTime());
String query = "Insert into entryTbl(name, joinedDate, ..etc) values ("abc", to_date(date, 'yyyy/mm/dd HH:mm:ss'))";
statement.executeUpdate(query);
但我得到 literal does not match 错误。所以甚至尝试使用“SYSDATE”。它只插入日期而不是时间。那么如何使用java将日期时间插入oracle?请任何人帮助..
【问题讨论】:
-
有什么不使用 PreparedStatement 的具体原因吗?