use of com.actiontech.dble.sqlengine.SetTestJob in project dble by actiontech.
the class SetHandler method setStmtCallback.
// execute multiStmt and callback to reset conn
private static void setStmtCallback(String multiStmt, ServerConnection c, List<Pair<KeyType, Pair<String, String>>> contextTask) {
c.setContextTask(contextTask);
OneRawSQLQueryResultHandler resultHandler = new OneRawSQLQueryResultHandler(new String[0], new SetCallBack(c));
Iterator<PhysicalDBPool> iterator = DbleServer.getInstance().getConfig().getDataHosts().values().iterator();
if (iterator.hasNext()) {
PhysicalDBPool pool = iterator.next();
SetTestJob sqlJob = new SetTestJob(multiStmt, pool.getSchemas()[0], resultHandler, c);
sqlJob.run();
} else {
c.writeErrMessage(ErrorCode.ER_YES, "no valid data host");
}
}
Aggregations