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.
Hi with the intention of keeping my DB layer separate from my servlets. I decided to create a separate class which connected to the DB
the class is as follows:
Now the servlet connects to this class and gets a result set which it packages in a bean and sends it to the jsp for displaying in a grid.
I read the best way to send the data of a result set is via beans. please correct me if i am wrong..
so my servlet code is something like this
Now I wanted the opinions of the experts out there is this the right directions ?? Could i make any improvements ?? Any suggestions ??
I would like to suggest used a static method inside your external class to retrieve the connection and rest if still you want to in other palace user another service class where used the static method and other parameter to give the result back to the Servlet.