@@ -0,0 +1,3198 @@
+package com.aws.jdbc;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.PreparedStatement;%0Aimport java.text.SimpleDateFormat;%0Aimport java.time.LocalDateTime;%0Aimport java.time.format.DateTimeFormatter;%0Aimport java.util.Date;%0Aimport java.util.UUID;%0A%0Aimport com.aws.entities.WorkItem;%0Aimport org.springframework.stereotype.Component;%0A%0A@Component%0Apublic class InjectWorkService %7B%0A%0A    //Inject a new submission%0A    public String modifySubmission(String id, String desc, String status)%0A    %7B%0A        Connection c = null;%0A        int rowCount= 0;%0A        try %7B%0A            // Create a Connection object%0A            c =  ConnectionHelper.getConnection();%0A%0A            //Use prepared statements to protected against SQL injection attacks%0A            //  PreparedStatement pstmt = null;%0A            PreparedStatement ps = null;%0A%0A%0A            String query = %22update work set description = ?, status = ? where idwork = '%22 +id +%22'%22;%0A%0A            ps = c.prepareStatement(query);%0A            ps.setString(1, desc);%0A            ps.setString(2, status);%0A            ps.execute();%0A            return id;%0A        %7D%0A        catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D%0A        finally %7B%0A            ConnectionHelper.close(c);%0A        %7D%0A        return null;%0A    %7D%0A%0A    //Inject a new submission%0A    public String injestNewSubmission(WorkItem item)%0A    %7B%0A        Connection c = null;%0A        int rowCount= 0;%0A        try %7B%0A%0A            // Create a Connection object%0A            c =  ConnectionHelper.getConnection();%0A%0A            // Use a prepared statement%0A            PreparedStatement ps = null;%0A%0A            //Convert rev to int%0A            String name = item.getName();%0A            String guide = item.getGuide();%0A            String description = item.getDescription();%0A            String status = item.getStatus();%0A%0A            //generate the work item ID%0A            UUID uuid = UUID.randomUUID();%0A            String workId = uuid.toString();%0A%0A            //Date conversion%0A            // Date date1 = new SimpleDateFormat(%22yyyy/mm/dd%22).parse(date);%0A            SimpleDateFormat dateFormat = new SimpleDateFormat(%22yyyy-MM-dd%22);%0A%0A            DateTimeFormatter dtf = DateTimeFormatter.ofPattern(%22yyyy/MM/dd HH:mm:ss%22);%0A            LocalDateTime now = LocalDateTime.now();%0A            String sDate1 =   dtf.format(now);%0A            Date date1 = new SimpleDateFormat(%22yyyy/MM/dd%22).parse(sDate1);%0A            java.sql.Date sqlDate = new java.sql.Date( date1.getTime());%0A%0A            //Inject a new Formstr template into the system%0A            String insert = %22INSERT INTO work (idwork, username,date,description, guide, status, archive) VALUES(?,?, ?,?,?,?,?);%22;%0A            ps = c.prepareStatement(insert);%0A            ps.setString(1, workId);%0A            ps.setString(2, name);%0A            ps.setDate(3, sqlDate);%0A            ps.setString(4, description);%0A            ps.setString(5, guide );%0A            ps.setString(6, status );%0A            ps.setBoolean(7, false);%0A            ps.execute();%0A            return workId;%0A        %7D%0A        catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D%0A        finally %7B%0A            ConnectionHelper.close(c);%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A

Create InjectWorkService.java