fgdsfgfdsgdsfgsdfg commented on issue #679:
URL:
https://github.com/apache/dolphinscheduler/issues/679#issuecomment-2485099903
Hello,我在使用2.x版本的dolphinscheduler,我发现了SQL
task不支持cancel没有实现,我想请问一下,是否可以通过缓存Statement对象,然后在cancel的时候通过调用Statement的cancel方法来取消SQL?类似于下面这种
```
private static final Map<String, Statement> ID_STATEMENT = new HashMap<>();
public static void cancel(String id) throws SQLException {
Statement statement = ID_STATEMENT.get(id);
// 若查询正在执行,调用 cancel() 方法进行取消
if (statement != null&&!statement.isCloseOnCompletion()) {
statement.cancel();
}
}
public static void add(String id, Statement statement) {
ID_STATEMENT.put(id, statement);
}
public static void remove(String id) {
ID_STATEMENT.remove(id);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]