/[projects]/miscJava/DataUpload/src/com/grundfos/gmatou/dataupload/PostConfig.java
ViewVC logotype

Contents of /miscJava/DataUpload/src/com/grundfos/gmatou/dataupload/PostConfig.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 593 - (show annotations) (download)
Sat Feb 20 06:43:13 2010 UTC (14 years, 3 months ago) by torben
File size: 983 byte(s)
added dumpsite for old java code
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 }

  ViewVC Help
Powered by ViewVC 1.1.20