How to truncate a table with Spring JdbcTemplate?
- by Marcus
I'm trying to truncate a table with Spring:
jdbcTemplate.execute("TRUNCATE TABLE " + table);
Get the error:
Caused by: org.springframework.jdbc.BadSqlGrammarException:
StatementCallback; bad SQL grammar
[TRUNCATE TABLE RESULT_ACCOUNT];
nested exception is
java.sql.SQLException: Unexpected
token: TRUNCATE in statement
[TRUNCATE]
Any ideas?