我正在使用spring JdbcTemplate。
public int countCallbackResponse(final int empId, final int noOfDay) {
int callbackCount = getJdbcTemplate().queryForInt(SurveyQuery.COUNT_CALLBACKS,
new PreparedStatementSetter() {
@Override
public void setValues(PreparedStatement ps) throws SQLException {
ps.setInt(1, empId);
ps.setInt(2, noOfDay);
}
}, Integer.class);
return callbackCount;
}
错误:
callback][org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT COUNT(sr.RESPONSEID) FROM EMPSUR s, EMPSURRES sr WHERE s.IEMPID = sr.IEMPID AND sr.IEMPID=? AND TRUNC(sr.TSCREATED) BETWEEN TRUNC(SYSDATE - (? + s.PRIORITY_DAYS)) AND TRUNC(SYSDATE) AND sr.SSTATUS IN ('SUS1','SUS1')]; SQL state [99999]; error code [17004]; Invalid column type; nested exception is java.sql.SQLException: Invalid column type]