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