I have some small jsp fragments stored in a database. The fragments are templates that are used to display objects in my system.
In other words you're looking for something which in some interpreted languages (Lisp, Perl etc.) is called "eval", to take a block of text (data) and evaluate/interpret it as runtime code.
If the fragments are just HTML (e.g. anything which just has to be inserted verbatim into the JSP output response), that's easier; you could just read them from the database in a bean, and then output them from a property of the bean (Struts "bean:write", JSP "getProperty").