我有一个更改查询
ALTER TABLE Table_name ADD(coumn1 DOUBLE,coumn2 DOUBLE);
我正在使用
this.namedParameterJdbcTemplate.execute(alterTableSQL, namedValues, new PreparedStatementCallback<Boolean>() {
@Override
public Boolean doInPreparedStatement(PreparedStatement ps) throws SQLException, DataAccessException {
return ps.execute();
}
});
执行语句时,它会抛出以下异常。
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [ALTER TABLE <sample> ADD (
coumn1 DOUBLE,
coumn2 DOUBLE
);]; nested exception is org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "ALTER TABLE TEMPLATE_1 ADD ([*]
coumn1 DOUBLE,
coumn2 DOUBLE
); "; expected "identifier"; SQL statement:
ALTER TABLE template_1 ADD (
coumn1 DOUBLE,
coumn2 DOUBLE
); [42001-160]
我该如何处理?