Ok, here is real world code, used in the real world, for financial purpose. It's an example, it's done using servlet; it could be done using something else; meanwhile, end user gets only HHTP thing and nothing else : I've got an main servlet class processing user's request; it then read an INI file and call other servlets; code exmaple : if ( Mess.equals( SQLMN )) { RequestDispatcher dispatch = etServletContext().getRequestDispatcher( SqlServlet + "?File=" + Mess1 + Mess2 + Mess4 ); dispatch.include(req, res); } As you can see, sql is readed in a file. I've got three servlets for handling sql requests : - one for insert, update to be done quickly - one for list box select, quick one - one for slow sql You've got here the last one, retrieving parameters and displaying results. The only problem I've got is the following : If a user cancel it's request, I do not detect it and sql query goes on. This particular user is meanwhile affected because next query will use the same queue; rather radical solution not certainly not a smart one ... So, here's the code, it might seem rather simple; it might work in an other manner using EJB. Otherwise, the idea seems good to me, having a process doing separately the job to handle database connection and so on. Good work - regards - j Brax
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 April 2009 12:59:52 GMT