Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value = "/updateProgram", method = RequestMethod.POST)
- @ResponseBody
- public String updateProgram(@RequestParam("name") String ProgramName,
- @RequestParam("description") String Description,
- @RequestParam("date") String DateTime,
- @RequestParam("user") String Users,
- @RequestParam("path") String ProgramPath,
- @RequestParam("active") Boolean Active,
- @RequestParam("seq") String Sequency,
- @RequestParam("topic") String Topic) {
- PreparedStatement stmt = null;
- try {
- Connection dbConnection = DriverManager.getConnection(
- "jdbc:sqlserver://database_url;database_name", "user", "password");
- String sql = "UPDATE dbo.vs_srv_programList SET programName_s=?, description_s=?, langId_s=?, dateEvt=?, userId_s=?, pathToProgram=?, active_b=?, seq_i=?, topic=? WHERE programId_i=?";
- stmt = dbConnection.prepareStatement(sql);
- stmt.setString(1, ProgramName);
- stmt.setString(2, Description);
- stmt.setDate(3, Date.valueOf(DateTime));
- stmt.setString(4, Users);
- stmt.setString(5, ProgramPath);
- stmt.setBoolean(6, Active);
- stmt.setString(7, Sequency);
- stmt.setString(8, Topic);
- stmt.executeUpdate();
- stmt.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- // return "OK";
- return "program-list.page";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement