@@ -0,0 +1,1479 @@
+package goodsbase.qserver;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.SQLException;%0Aimport java.sql.Statement;%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;%0A%0A%0A/**Can execute UPDATE and DELETE requests%0A * Executes only first query in the request%0A * @author Daria%0A */%0Apublic class UpdateTask implements DbTask %7B%0A%0A%09/**@throws UnacceptableRequestException in case of invalid request*/%0A%09public UpdateTask(QRequest request) %7B%0A%09%09if (request.getType()!=QRequest.Type.UPDATE)%0A%09%09%09throw new UnacceptableRequestException(%22Request type must be UPDATE%22);%0A%09%09if(request.getBody().size()!=1)%0A%09%09%09throw new UnacceptableRequestException(%22Invalid number of queries%22);%0A%09%09this.query = request.getBody().get(0);%0A%09%7D%0A%0A%09@Override%0A%09public void execute(Connection c) %7B%0A%09%09try %7B %09%09%09%0A%09%09%09stat = c.createStatement();%0A%09%09%09stat.executeUpdate(query);%0A%09%09%7D catch (SQLException e) %7B%0A%09%09%09exceptions.add(e);%0A%09%09%09log.log(Level.WARNING, %22Exception caught while executing query%22, e);%0A%09%09%7D %0A%09%09complete = true;%09%09%0A%09%7D%0A%0A%09@Override%0A%09public boolean isComplete() %7B%0A%09%09return complete;%0A%09%7D%0A%09%0A%09/**Returns the list of exceptions occurred during execution*/%0A%09public List%3CSQLException%3E getExceptions() %7B%0A%09%09return exceptions;%0A%09%7D%0A%09%0A%09private static final Logger log = Logger.getLogger(BatchTask.class.getName());%0A%09private String query;%0A%09private List%3CSQLException%3E exceptions = new LinkedList%3CSQLException%3E();%0A%09private boolean complete = false;%0A%09protected Statement stat;%0A%7D%0A

add update task new file: src/goodsbase/qserver/UpdateTask.java