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 Ramesh, You would find lots of information on how to connect the Applet/JSP/Servlet to the Database in various books available in the market.You may refer to Pure JSP By James Goodwill for some examples. There is nothing tricky about this.You can access DB using the usual JDBC steps, viz. creating a connection, creating a statement,creating a resultset and iterating through it. If you are using the Applet-Servlet-DB architecture, write the JDBC code in the Servlet and that too in the init() (or I suggest you use Connection Pooling..Pure JSP has an example for it) for performance benefits. If you are using the Applet-JSP-DB architecture, write the JDBC code in the JSP.You may consider writing the JDBC calls in the JavaBean and create an instance of the bean using the <jsp:usebean> tag. Hope this helps. Regards, Sandeep Desai email@example.com
Santosh, JSP's are compiled into servlets so these are functionally equivalent. Assuming your applet takes care of the view, you might see some performance benefit with pure servlets in some applications.