JSP code runs on the server when the request from the browser is being handled, and generates the HTML for the page to return to the browser. jQuery is just JavaScript, which runs in the browser, so the two are entirely separate. The JSP has already run in its entirety well before the JavaScript/jQuery code even reaches the browser.
What you'll need to do is write server-side code to store values in your database, then use an AJAX request to send the values to that action. jQuery has a number of functions that simplify AJAX requests, though the base one is the jQuery.ajax()
function. Your call would look something like this:
$.ajax({
url: 'yourPage.jsp',
data: {
newValue: d1
},
type: 'post',
success: function(returnedData) {
// do something with the server response
}
});