package com.grundfos.gmatou.dataupload; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class PostConfig extends HttpServlet { private static final long serialVersionUID = 1L; public PostConfig() { super(); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { String value = request.getParameter("value"); Connection conn = DBConnection.getDbConnection(); PreparedStatement stmt = conn.prepareStatement("UPDATE config SET modified=now(), value=?"); stmt.setString(1, value); stmt.execute(); } catch (Exception e) { throw new ServletException(e); } response.sendRedirect("EditConfig"); } }