I had a look at the JSTL sql tags and couldnt see anything how to do this. Possibly the reason is you shouldnt! Better not to have this sort of thing in JSP. I would recommend putting the database access in a business logic code i.e. a java class....
Tom has it correct. A JSP is no place to be doing SQL access. Write this as a standalone Java class that you could trigger from a JSP if necessary, but do not perform database access in UI classes or JSPs.