Two approaches come to mind:
1) The onselect handler of the select box resubmits the page whose server-side controller (preferable a
servlet rather than JSP-embedded
Java) interacts with the Model (or DB) to get the values for the second box. The page redraws itself with these values.
2) The onselect handler of the select box submits a request into a hidden iframe that does the DB dirty work and returns as its response a gaggle of Javascript that rewrites the options of the second select box.
Pick your poison.