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())
它在查询行中返回异常:
SQL 状态 [99999];错误代码 [17004];无效的列类型;嵌套异常是 java.sql.SQLException: Invalid column type at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
有人知道为什么它不起作用吗?
谢谢