<%@page import="javax.jdo.*,java.util.Iterator,models.*,models.pc.*" %> <%@page isThreadSafe="false" %> <%-- more efficient and safe in a website which is not too loaded --%> <%@page errorPage="/error.jsp"%> <%! static { WebAppMgr.enhanceAll(); } %> Models List <% // Obtain a PersistenceManager instance: PersistenceManager pm = WebAppMgr.getPersistenceManager(application); try { // Handle a filled form (if any): String Vid = request.getParameter("Hid"); String Vname = request.getParameter("Hname"); if (Vid != null && Vname != null) { pm.currentTransaction().begin(); pm.makePersistent(new Category(Vid.charAt(0),Vname)); pm.currentTransaction().commit(); } %>

The Models List


ID :
Name :

    <% Extent extent = pm.getExtent(Category.class, false); Iterator itr = extent.iterator(); while (itr.hasNext()) { %>
  1. <%= itr.next() %>
  2. <% } extent.close(itr); %>

<% } finally { // Close the PersistenceManager: if (pm.currentTransaction().isActive()) pm.currentTransaction().rollback(); pm.close(); } %> Powered by ObjectDB Java/JDO Database