|
|
@ -40,15 +40,16 @@ public class DynamicTaskDAOImpl implements DynamicTaskDAO {
|
|
|
|
int taskId = -1;
|
|
|
|
int taskId = -1;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Connection conn = TaskManagementDAOFactory.getConnection();
|
|
|
|
Connection conn = TaskManagementDAOFactory.getConnection();
|
|
|
|
String sql = "INSERT INTO DYNAMIC_TASK(CRON, NAME, IS_ENABLED, TASK_CLASS_NAME, TENANT_ID) " +
|
|
|
|
String sql = "INSERT INTO DYNAMIC_TASK(CRON, NAME, IS_ENABLED, TASK_CLASS_NAME, OPERATION_REQUEST, TENANT_ID) " +
|
|
|
|
"VALUES (?, ?, ?, ?, ?)";
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?)";
|
|
|
|
|
|
|
|
|
|
|
|
stmt = conn.prepareStatement(sql, new String[]{"DYNAMIC_TASK_ID"});
|
|
|
|
stmt = conn.prepareStatement(sql, new String[]{"DYNAMIC_TASK_ID"});
|
|
|
|
stmt.setString(1, dynamicTask.getCronExpression());
|
|
|
|
stmt.setString(1, dynamicTask.getCronExpression());
|
|
|
|
stmt.setString(2, dynamicTask.getName());
|
|
|
|
stmt.setString(2, dynamicTask.getName());
|
|
|
|
stmt.setBoolean(3, dynamicTask.isEnabled());
|
|
|
|
stmt.setBoolean(3, dynamicTask.isEnabled());
|
|
|
|
stmt.setString(4, dynamicTask.getTaskClassName());
|
|
|
|
stmt.setString(4, dynamicTask.getTaskClassName());
|
|
|
|
stmt.setInt(5, PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
|
|
|
|
stmt.setString(5, dynamicTask.getOperationRequest());
|
|
|
|
|
|
|
|
stmt.setInt(6, PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
|
|
|
|
stmt.executeUpdate();
|
|
|
|
stmt.executeUpdate();
|
|
|
|
|
|
|
|
|
|
|
|
rs = stmt.getGeneratedKeys();
|
|
|
|
rs = stmt.getGeneratedKeys();
|
|
|
|