Update data in database through jquery.
<script>
$(document).ready(function(){
$("#add").click(function(){
$.ajax({
type: "post",
url: "subquantity.jsp",
data: {
input: $('#pc').val(),
output: $('#sq').val()
},
success: function(msg)
{
}
});
});
});
</script>
subquantity.jsp
<%--
Document : subquantity
Created on : Aug 6, 2014, 2:24:05 PM
Author : NAVJYOTI
--%>
<%@page import="Connect.Invent"%>
<%@page import="java.sql.Connection"%>
<%@page import="Connect.databse"%>
<%@page import="Connect.*"%>
<jsp:useBean id="i" class="Connect.Invent"/>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
String iii=request.getParameter("input");
int q=Integer.parseInt(request.getParameter("output"));
System.out.println(q);
Invent ii=new Invent(iii,q);
ii.updatequantity();
String bina=request.getParameter("bill");
String bidat=request.getParameter("billdate");
String on=request.getParameter("on");
String cn=request.getParameter("cn");
String bt=request.getParameter("bt");
String od=request.getParameter("od");
%>
</body>
</html>