II can help you translate this example but can you explain in words
what id does? I am not 100% sure.
>
> public void processRequest(HttpServletRequest request,
>                         HttpServletResponse response) throws IOException, 
> ServletException
> {
>                 String resource= "";
>                 String param = request.getParameter("param");
>                 if (param == null)
>                 {
>                         ProviderDAOImpl prov = new ProviderDAOImpl();
>                         Collection c = prov.showProvider();
>                         HttpSession sesion = request.getSession();
>                         sesion.setAttribute("provider", c);
>
>                         recurso = "/Registro.jsp";
>                 } else {
>                         if (param.equals("submit")) {
>                                 String puppy = 
> request.getParameter("txtPuppy");
>                                 StoreBean ab = new StoreBean();
>                                 ab.setNPuppy(Integer.parseInt(puppy));
>                                 RegStoreDAOImpl reg = new RegStoreDAOImpl();
>                                 reg.submit(ab);
>                                 recurso = "/Registro.jsp";
>                         }
>                 }
>                 response.sendRedirect(response.encodeURL("/BDFWeb" + 
> recurso));
>         }
>
> then in the controller i have the DAOImpl
>
> public void submit(StoreBean ab) {
>                 Connection con = null;
>                 CallableStatement csmt = null;
>                 String SQL = "{ call uspIngresoSacos(?,?,?,?) }";
>                 con = conectar("jdbc/Store");
>                 try {
>                         csmt = con.prepareCall(SQL);
>                         csmt.setInt(2, ab.getNPuppy());
>                         csmt.execute();
>                 } catch (SQLException e) {
>                         e.printStackTrace();
>                 } finally {
>                         freeStatement(csmt);
>                         freeConnection(con);
>                 }
>         }
> well this calls the DAO and the Datasource with songleton pattern
>
> The next is the model: that have the getters and setters.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to