1
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
String query = "select a.alert_id from alert a where (alert.last_execution is null or trunc(alert.last_execution) < to_date(?, 'dd/MM/yyyy')) and alert.frequency = ?";
jdbcTemplate.query(query, new Object[] {sdf.format(new Date()), "DAILY"}, new AlertRowMapper())
它retuns在查询线异常:弹簧JDBC模板查询与字符串/ VARCHAR参数
SQL状态[99999];错误代码[17004];无效的列类型;嵌套的异常是java.sql.SQLException中:无效的列式 在org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
难道有人知道为什么它不工作?
感谢
感谢您的答复,我试过和不工作,同样的错误:( – andre
你能不能给我们的模式 – bazwilliams
ALERT_ID \t数(19); 频率\t VARCHAR2(50); last_execution \t时间戳(0)与时区; – andre