This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
What does "without processing the entire JSP" mean? If parts of the JSP code shouldn't be executed you can wrap them inside an if statement with an appropriate condition. Generating output based on Db values can be done anywhere in a JSP page, so that's not a constraint.
Note that it's considered bad design to keep DB code in a JSP; at the very least, move it into a backing bean.