anchor.diff:  						d_pstmt.setString(2, ""+request.getParameter("sku"));
   						d_pstmt.setString(3, ""+request.getParameter("img_url"));
   						d_pstmt.setString(4, ""+request.getParameter("description"));
  +						d_pstmt.setDouble(5, Double.valueOf(""+request.getParameter("price")));
  +						d_pstmt.setInt(6, Integer.parseInt(request.getParameter("pid")));
   						
  +						conn.commit();
  +						sql =	"UPDATE products_categories SET (category_id) = " +
  +								"(?) WHERE product_id = ?";
  +						d_pstmt = conn.prepareStatement(sql);
  +						d_pstmt.setInt(1, Integer.parseInt(request.getParameter("new_category_id")));
  +						d_pstmt.setInt(2, Integer.parseInt(request.getParameter("pid")));
  +						conn.commit();
  +						conn.setAutoCommit(true);
   						//ERROR HERE with the double casting from string
  -						d_pstmt.setDouble(5, Double.valueOf(""+request.getParameter("price")));
  -						d_pstmt.setInt(6, Integer.parseInt(request.getParameter("cid")));
   
   						int count = d_pstmt.executeUpdate();
   						d_pstmt.close();
   						conn.close();
  -						if(count != 0){
  -							%>
  -							<t:message type="success" message="Product successfully updated"></t:message>
  -							<%
  -							}
  -						else{
  -							%>
  -							<t:message type="danger" message="Error occurred in SQL"></t:message>
  -							<%
  -						}
  +						
  +						%>
  +						<t:message type="success" message="Product successfully updated"></t:message>
  +						<%
   					}
   					catch(SQLException e){
   						e.printStackTrace();
  +						conn.rollback();
   						%>
   						<t:message type="danger" message="<%=e.getMessage() %>"></t:message>
   						<%
  
positive.code: 							<input id="sku" name="sku" type="text" placeholder="SKU" class="form-control">
  							
  							<label class="control-label" for="img_url">Category</label>
  							<select class="form-control" name="category">
  								<% 
  								
  								try{	
  
negative.code: 									while(rs.next())
  									{
  										String c = rs.getString("name");
  										String old_id = rs.getString("category_id");
  										String selected = (c.equals(old_id)) ? "selected":""; %>
  										<option <%=selected%> value="<%=old_id %>"><%=c %></option>
  								<% }
  									statement.close();
  									rs.close();
  