java todo error_java.sql.SQLException: sql injection violation, syntax error: TODO UNIQUE unique
@wenshao 你好,想跟你請教個問題:
我是在用activiti工作流的時候 ?初始化生成流程表產生了下面的問題
工作流引擎代碼:
ProcessEngineConfiguration config = ProcessEngineConfiguration
.createStandaloneProcessEngineConfiguration();
config.setDataSource(dataSource).setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE).buildProcessEngine();
報錯信息:
Caused by: java.sql.SQLException: sql injection violation, syntax error: TODO UNIQUE unique: alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_)
at com.alibaba.druid.wall.WallFilter.check(WallFilter.java:724)
at com.alibaba.druid.wall.WallFilter.statement_execute(WallFilter.java:396)
at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2487)
at com.alibaba.druid.filter.FilterAdapter.statement_execute(FilterAdapter.java:2451)
at com.alibaba.druid.filter.FilterEventAdapter.statement_execute(FilterEventAdapter.java:188)
at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2487)
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.execute(StatementProxyImpl.java:137)
at com.alibaba.druid.pool.DruidPooledStatement.execute(DruidPooledStatement.java:421)
at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:1368)
... 32 more
Caused by: com.alibaba.druid.sql.parser.ParserException: TODO UNIQUE unique
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseAlterTable(MySqlStatementParser.java:2375)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseAlter(MySqlStatementParser.java:2297)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:217)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:145)
at com.alibaba.druid.wall.WallProvider.checkInternal(WallProvider.java:620)
at com.alibaba.druid.wall.WallProvider.check(WallProvider.java:574)
at com.alibaba.druid.wall.WallFilter.check(WallFilter.java:711)
... 40 more
druid版本:1.0.15,1.0.21(測試了這兩版本) mysql驅動版本:5.1.32
語句:
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_)
單獨拿出來跑是沒有問題的
另:我換了HikariCP 沒有出現問題,是不是我對Druid的配置出現了問題
總結
以上是生活随笔為你收集整理的java todo error_java.sql.SQLException: sql injection violation, syntax error: TODO UNIQUE unique的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 小米10pro第二个摄像头下面_小米10
- 下一篇: python常用函数的用法_python