Web Hosting Java, JSP, Tomcat 6, J2EE, Servlets, Struts, Jboss
Cms hosting - JavaSercer Pages The initialization servlet should also clean
January 24, 2007 on 3:35 am | In Java | JavaSercer Pages The initialization servlet should also clean up when the application is shut down. The web container calls the destroy( ) method: public void destroy( ) { getServletContext( ).removeAttribute(”exampleDS”); } Most connection pools used in production provide a method that should be called at shutdown to let it close all connections. If you use such a pool, you need to call this method in the servlet’s destroy( ) method as well. The example pool used here doesn’t provide a shutdown method. 17.2 Using a Generic Database Bean All the database custom action tag handler classes described later in this chapter are based on a generic database bean named com.ora.jsp.sql.SQLCommandBean . This bean uses a number of other classes. Figure 17.3 shows the relationship between all these classes. Figure 17.3. The SQLCommandBean and related classes The SQLCommandBean takes care of setting all values in a JDBC java.sql.PreparedStatement and executing the statement. For SELECT statements, it also processes the result by creating com.ora.jsp.sql.Row objects containing a com.ora.jsp.sql.Column object for each column in the result. The rows returned by the SELECT statement are returned to the caller as a java.util.Vector with Row objects. The EmployeeRegistryBean described in Chapter 15 is one example of how to use this bean, and other examples follow in this chapter. Let’s look at each class in detail, starting with the SQLCommandBean itself. page 242
Quick Hint: If you are looking for cheap and reliable provider to host and run your servlet application check Vision servlet hosting plans
No Comments yet
Sorry, the comment form is closed at this time.
...I
just wanted to take the time to say "Thank you!" for our new webmail
system. It's great! Thanks for taking such good care of us.
Thanks
for helping me out. Just for the record, Webhostingjava.net has been a great
web host! So far your support and handling of questions has far
exceeded that of a "larger web hosting company".
I
would like to thank you for helping me with my domain...You have
shown me great patience and professionalism. I would not hesitate to
recommend you to my clients.