The star rating is automatically inserted into a hidden form element named "hiddenRating". You can use that form element to update the database just like you would any other form element, by using an insert or update server behavior and specifying the hidden form element for the value.
You would put it in a form and either associate a button with it or add a formname.submit() javascript call to the onclick so that the form is automatically submitted and can be inserted.