The first jsp page (send1.jsp) displays all data from the MySQL database, and consists of an edit button for each row.

Once the user clicks on the edit button for a particular row, the size variable of that row will be passed to the next jsp page (receive1.jsp)

receive1.jsp will accept the value and then use the value for the Update PreparedStatement.

When the user clicks 'update' in the 2nd jsp page, the size value which the user typed will be stored into a variable and used for the Update PreparedStatement as well.

However after doing so, the UPDATE doesn't have any effect on the MYSQL database; nothing happens.

Thanks for any help rendered.

send1.jsp

    <%@ page import ="java.sql.*" %> 
    <body>
    	<!------------------------ Default Table title Display--------------------------------->	
    	<table border="1">
    	<tr>
    	<td>Size</td>
    	<td>Taste</td>
    	</tr>
 
    <%
 
    PreparedStatement pstmt;
 
    pstmt = conn.prepareStatement("Select * from shoe_db");
 
    ResultSet rs = pstmt.executeQuery();
 
    while(rs.next()){
       out.println("<form action ='send1.jsp' method='post'");
       out.println("<tr>");
       out.println("<td>" + rs.getString("size") + "</td>");
       out.println("<td>" + rs.getString("taste") + "</td>");
       out.println("<td> <input type='hidden' name='hidden' value='"+rs.getString("size")+"'> < input type='submit' name='editm' value='Edit'>  </td>");
       out.println("</tr>");
       out.println("</form>");
    }
    String getmov3 ="";
    // check if Edit button is clicked
    if(request.getParameter("editm") != null) {
    	getmov3 = request.getParameter("hidden");
      // DEBUG
    	System.out.println("getmov3 is "+getmov3);
    response.sendRedirect("receive1.jsp?getmov3="+getmov3);
    }
    //conn.close();
    %>
    </table>
    </body>
    </html>

receive1.jsp

	<%@ page import ="java.sql.*" %> 
 
	<body>
	<%
	//Register JDBC driver
	Class.forName("com.mysql.jdbc.Driver");
	//Define Connection URL
	String connURL = "jdbc:mysql://localhost/dumbs?user=root&password=rootlah213";
	//Establish connection to URL
	Connection conn =   DriverManager.getConnection(connURL); 
	%>
 
	<form action = 'receive1.jsp' method='post'>
		<table border="0">
		<tr>
		<td>Enter Size to be changed to:</td><td><input type='text' size=15 name='gs' ></td>
		</tr>
		<tr>
		<td><input type='submit' size=15 name='Updatebutton' value='Update' ></td>
		</tr>
		</table>
		</form>
 
 
	<%
	String sizeg = request.getParameter("getmov3");
	System.out.println("sizeg is "+sizeg);
 
	String getsize = "";
	// check if Update button is clicked
	if(request.getParameter("Updatebutton") != null) {
		// get what user enterd in Size text box
		getsize = request.getParameter("gs");
		// DEBUG
		System.out.println("getsize is "+getsize);
		PreparedStatement pstmt4;
 
		pstmt4 = conn.prepareStatement("UPDATE shoe_db SET size=? WHERE size=?");
		pstmt4.setString(1,getsize);
		pstmt4.setString(2,sizeg);
		pstmt4.executeUpdate();
	}
 
	%>
 
	</body>
	</html>