Question: I am working on a web application that is used to print user receipts based on the supplied receipt number. I want to enhance it in such a way that when i supply receipt numbers from 1 to 100 it will print all 100 receipts. Is there any ways in Java to implement this. How can i implement this in Java ?

Answer: 
Good frameworks give you a ready solution to common problems. Reinventing solutions for yourself probably will be excessive work. As a learning exercise coming up with stuff for yourslef has some value. To get a real job done efficiently use a framework. 

This does assume that good frameworks exist in your world ...
I currently am developing in the PHP framework Kohana (version 3). There is also a way to make models (for the (H)MVC pattern) very quickly using ORM. For more information look at this: <http://kohanaframework.org/guide/tutorials.orm> and take a look at <http://kohanaframework.org/guide/api> and <http://kohanaframework.org/download>