1 |
package com.grundfos.gmatou.dataupload;
|
2 |
|
3 |
import java.io.IOException;
|
4 |
import java.sql.Connection;
|
5 |
import java.sql.PreparedStatement;
|
6 |
|
7 |
import javax.servlet.ServletException;
|
8 |
import javax.servlet.http.HttpServlet;
|
9 |
import javax.servlet.http.HttpServletRequest;
|
10 |
import javax.servlet.http.HttpServletResponse;
|
11 |
|
12 |
public class PostConfig extends HttpServlet {
|
13 |
private static final long serialVersionUID = 1L;
|
14 |
|
15 |
public PostConfig() {
|
16 |
super();
|
17 |
}
|
18 |
|
19 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
20 |
|
21 |
try
|
22 |
{
|
23 |
String value = request.getParameter("value");
|
24 |
Connection conn = DBConnection.getDbConnection();
|
25 |
PreparedStatement stmt = conn.prepareStatement("UPDATE config SET modified=now(), value=?");
|
26 |
stmt.setString(1, value);
|
27 |
stmt.execute();
|
28 |
} catch (Exception e) {
|
29 |
throw new ServletException(e);
|
30 |
}
|
31 |
|
32 |
response.sendRedirect("EditConfig");
|
33 |
}
|
34 |
|
35 |
}
|