Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
| dad2:bbdd [2024/04/09 10:39] – thejuanvisu | dad2:bbdd [2024/04/09 11:09] (actual) – thejuanvisu | ||
|---|---|---|---|
| Línea 3: | Línea 3: | ||
| <code xml contex.xml> | <code xml contex.xml> | ||
| < | < | ||
| - | < | + | < |
| maxActive=" | maxActive=" | ||
| username=" | username=" | ||
| Línea 10: | Línea 10: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | <code java Control.java> | ||
| + | public class Control extends HttpServlet{ | ||
| + | private static final long serialVersionUID = 1L; | ||
| + | public static final String PRM_ACCION = " | ||
| + | | ||
| + | private Hashtable< | ||
| + | private static Factory factory = null; | ||
| + | | ||
| + | public void init() throws ServletException{ | ||
| + | system.out.println(" | ||
| + | PrepareStatement ps = null; | ||
| + | resultSet rs = null; | ||
| + | try{ | ||
| + | Connection con = Control.ds.getConnection(); | ||
| + | ps = con.prepareStatement (" | ||
| + | rs = ps.executeQuery; | ||
| + | | ||
| + | Action Accion = null; | ||
| + | this.hashAcciones = new Hashtable< | ||
| + | while(rs.next()){ | ||
| + | accion = (Accion)Class.forName(rs.getString(" | ||
| + | String id = res.getString(" | ||
| + | System.out.println(id + "" | ||
| + | this.hashAcciones.put(id, | ||
| + | } | ||
| + | | ||
| + | }catch(SQLException e){ | ||
| + | System.out.println(" | ||
| + | } catch(InstantActionException e){ | ||
| + | e.printStackTrace(); | ||
| + | } catch(IllegalAccessException e){ | ||
| + | e.printStackTrace(); | ||
| + | } catch(ClassNotFoundException e){ | ||
| + | e.printStackTrace(); | ||
| + | } finally { | ||
| + | try{ | ||
| + | if (rs != null) rs.close(); | ||
| + | if (ps != null) ps.close(); | ||
| + | } catch (SQLException e){ | ||
| + | e.printStackTrace(); | ||
| + | } | ||
| + | } | ||
| + | | ||
| + | System.Out.Println(" | ||
| + | } | ||
| + | } | ||
| + | | ||
| + | | ||
| + | protected void doGet(HttpServletRequest request, httpServlet Response response){ | ||
| + | | ||
| + | } | ||
| + | | ||
| + | </ | ||
| + | {{drawio> | ||