Tham khảo tài liệu 'xml by example- p10', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | The Data Tier 435 Listing package import . import . import . import . Simple console to create database and enter data in the SQL database. inversion Dec 23 1999 author Benoit Marchal bmarchal@ public class XMLServerConsole extends HttpServlet handles GET request @param request HTTP request @param response hold the response exception SerlvetException error handling the request exception lOException error writing the reply protected void doGet HttpServletRequest request HttpServletResponse response throws ServletException lOException doProcess request response handles GET request @param request HTTP request @param response hold the response exception SerlvetException error handling the request continues 436 Chapter 12 Putting It All Together An e-Commerce Example Listing continued exception lOException error writing the reply protected void doPost HttpServletRequest request HttpServletResponse response throws ServletException lOException doProcess request response GET and POST requests are forwarded here @param request HTTP request @param response hold the response exception SerlvetException error handling the request exception lOException error writing the reply protected void doProcess HttpServletRequest request HttpServletResponse response throws ServletException lOException String sqlDriver getInitParameter sqlURL getInitParameter sqlUser getInitParameter sqlPassword getInitParameter try sqlDriver Connection connection sqlURL sqlUser sqlPassword try String action action if null action if create doUpdates request connection createStatements The Data Tier 437 else if drop doUpdates request connection dropStatements else if delete doDelete request connection else if .