Я пытаюсь протестировать свои запросы DB2 с h2database, но у меня возникают проблемы при попытке усечь таблицу.
Вот мой запрос: TRUNCATE TABLE SCHEMA.TABLE_NAME IMMEDIATE
Ошибка:
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "TRUNCATE TABLE TOPACC.STREAM_FORECAST IMMEDIATE[*]"; SQL statement:
TRUNCATE TABLE TOPACC.STREAM_FORECAST IMMEDIATE [42000-199]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
Моя конфигурация:
private Properties hibernateProperties() {
Properties properties = new Properties();
properties.put("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
properties.put("hibernate.show_sql", true);
properties.put("hibernate.default_schema", "SCHEMA_NAME");
properties.put("hibernate.connection.driver_class", "org.h2.Driver");
properties.put("hibernate.connection.username", "NAME");
properties.put("hibernate.connection.password", "");
properties.put("hibernate.connection.url", "jdbc:h2:mem:testdb;MODE=DB2;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS SCHEMA_NAME");
properties.put("hibernate.hbm2ddl.auto", "create");
return properties;
}