TOTD #15: Delete/Update Row from Database using jMaki Data Table

Guest Author


Previous Entry
explained how a Data Table widget can be populated from a
database using Java Persistence API (JPA). This TOTD extends that entry and
explains how a selected row from the Data Table can be deleted from the
database. This entry is created based upon a requirement from Dave Briccetti at
Silicon Valley Code Camp 2007 last weekend.

The first part of the entry is also a re-write of using
NetBeans 6 and the latest

jMaki NetBeans plugin

  1. Create the Web application project

    1. In NetBeans 6 IDE, create a new 'Web Application

      project and name it as 'jmaki-database.

    2. Choose GlassFish V2 as the

      server as shown below:

    3. Click on 'Next button, add 'jMaki Ajax Framework

      and choose 'Standard layout as shown below:

      and click on 'Finish button.

  2. Configure the Database

    1. In NetBeans IDE, 'Runtime tab, expand Databases, connect

      to the default database (with the URL 'jdbc:derby://localhost:1527/sample

      [app on APP]). Specify the username 'app and password


    2. Right-click again on the URL and select 'Execute Command...

      and issue the command:

      create table BOOKS (title varchar(255),

                          author varchar(255),

                          isbn varchar(255),

                          description varchar(255),

                          PRIMARY KEY (isbn))

      This will create the database table.

    3. Add data to the newly created table using the following command:

      INSERT INTO BOOKS VALUES('Galloway Book of Running', 'Jeff Galloway',

      'ABC001', 'The best book on running');

      INSERT INTO BOOKS VALUES('The Complete Book of Running', 'James Fixx',

      'ABC002', 'Oldest book of running');

      INSERT INTO BOOKS VALUES('The Runners Handbook', 'Bob Glover', 'ABC003',

      'Bestselling Guide for Beginning and Intermediate Runners');

      INSERT INTO BOOKS VALUES('Daniel Running Formula', 'Jack Tupper Daniels',

      'ABC004', 'Proven programs 800m to Marathon');

      INSERT INTO BOOKS VALUES('Chi Running', 'Danny Drever', 'ABC005',

      'Revolutionary approach to effortless, injury-free running');

      INSERT INTO BOOKS VALUES('Running for Mortals', 'John Bingham', 'ABC006', 'A

      common sense plan for changing your life through running');

      INSERT INTO BOOKS VALUES('Marathoning for Mortals', 'John Bingham',

      'ABC007', 'Regular person guide to marathon');

      INSERT INTO BOOKS VALUES('Marathon', 'Hal Higdon', 'ABC008', 'The Ultimate

      Training Guide');

      This will add 8 rows to the table.

      You can enter additional rows if you like.

  3. Create the JPA Entity class that maps to the database

    1. In the projects window, select the project 'jmaki-database,

      right-click and select 'New and choose 'Entity

      Classes From Database....

    2. Select 'jdbc/sample as 'Data Source.

    3. Select 'BOOKS in 'Available Tables and

      click on 'Add and enter the values as shown below:

      and click on 'Next.

    4. Specify the package name as 'server as shown below:

    5. Click on 'Create Persistence Unit... to create the

      persistence unit and enter the values as shown below:

      and click on 'Create.

    and click on 'Finish.

  4. Add the following named query to the generated JPA class:

    @NamedQuery(name = "Books.findAll", query = "SELECT b FROM Books b")

  5. Configure Persistence Unit

    1. In your project, expand 'Configuration Files and open


    2. Click on 'Add Class button and  choose 'server.Books

      class and click 'OK. This will ensure that the generated

      entity class is explicitly recognized by the EntityManagerFactory.

  6. In your project, right-click on 'Web Pages, select 'New

    and then 'JSP.... Give the name as 'data as


    and then click on 'Finish.

  7. Replace the entire content of template 'data.jsp with the


    <%@ page import="java.util.\*" %>

    <%@ page import="server.Books" %>

    <%@ page import="javax.persistence.\*" %>


      EntityManagerFactory emf =


      EntityManager em = emf.createEntityManager();

      List<Books> list = em.createNamedQuery("Books.findAll").getResultList();

      out.println("{columns : [" +

        "{ label : 'Title', id : 'title'}," +

        "{ label :'Author', id : 'author'}," +

        "{ label :'ISBN', id : 'isbn'}," +

        "{ label :'Description', id : 'description'}" +


        out.println("rows: [");

        for (int i=0; i<list.size(); i++) {

          Books b = list.get(i);

          out.print("{ id: '" + b.getIsbn() + "', " +

            "title: '" + b.getTitle() + "'," +

            "author: '" + b.getAuthor() + "'," +

            "isbn: '" + b.getIsbn() + "'," +

            "description: '" + b.getDescription()

    + "'}");

          if (i < list.size()-1)





        out.println("] }");


  8. Add and Configure a jMaki Data Table widget

    1. In the generated 'index.jsp, drag-and-drop a 'Yahoo Data Table widget from the jMaki Palette in the 'Main

      Content Area.

    2. Change the generated code fragment from:

      <a:widget name="yahoo.dataTable"

          value="{columns :



      { label : 'Title', id : 'title'},


      { label :'Author', id : 'author'},


      { label : 'ISBN', id : 'isbn'},


      { label : 'Description', id : 'description'}


                  rows :



      { title : 'Book Title 1', author : 'Author 1', isbn: '4412', description

      : 'A Some long description'},


      { id : 'bar', title : 'Book Title 2', author : 'Author 2', isbn :

      '4412', description : 'A Some long description'}


                 }" />


      <a:widget name="yahoo.dataTable" service="data.jsp" />

      The 'service' attribute tells jMaki runtime to retrieve the data

      for DataTable widget from 'data.jsp instead of the using static


    3. Click on the Green button in NetBeans IDE to run the project or

      default keyboard shortcut (F6). And your browser shows the application

      deployed as:

      This jMaki-wrapped Yahoo Table Table widget is pulling data from JavaDB.

  9. Now update the project to enable deletion of rows from database based

    upon row selection. Expand 'Source Packages, 'server,

    edit 'Books.java and add the following NamedQuery:

    @NamedQuery(name = "Books.deleteByIsbn", query = "DELETE FROM Books b

    WHERE b.isbn = :isbn")

  10. In your project, right-click on 'Web Pages, select 'New

    and then 'JSP.... Give the name as shown:

    and then click on 'Finish.

  11. Replace the entire content of template 'delete.jsp with the


    <%@ page import="javax.persistence.\*" %>


      String isbn = request.getParameter("isbn");

      EntityManagerFactory emf =


      EntityManager em = emf.createEntityManager();



        setParameter("isbn", isbn).




  12. Expand 'Web pages and edit 'glue.js to add

    the following fragment in '\*onSelect subscribe method:

    jmaki.doAjax({method: "POST",

      url: "delete.jsp?isbn=" + encodeURIComponent(args.value.isbn),

      callback: function(_req) {

        jmaki.publish('/jmaki/table/removeRow', { targetId:

    args.value.isbn });



  13. Change the generated code fragment in 'index.jsp as:

    <a:widget name="yahoo.dataTable" service="data.jsp" subscribe="/jmaki/table"/>

That's it! Now clicking on any row of the table will delete that particular
row from the database and also from the table. If jMaki Debugger Console is
enabled, then the messages are shown as below:

Using the similar steps described in bullet #9-13, a row can be
updated in the database.

Please leave suggestions on other TOTD that you'd like to see. A complete
archive is available here.







Join the discussion

Comments ( 44 )
  • Manoj Wednesday, October 31, 2007

    Hi Arun,

    The example code you have shown here is quite interesting but i am receiving an error like this "Failed to load data: doAjax error communicating with CustomerData.jsp. Server returned status code 500."

    I have performed your sample codes above onto the customer table available in derby default tables. When i examined the fault using firebug i got the following error:

    </head><body><h1>HTTP Status

    500 - </h1><hr/><p><b>type</b> Exception report</p><p><b>message</b></p><p><b>description</b>The server

    encountered an internal error () that prevented it from fulfilling this request.</p><p><b>exception

    </b> <pre>org.apache.jasper.JasperException: javax.persistence.PersistenceException: No Persistence provider

    for EntityManager named WebApplication3PU: Provider named oracle.toplink.essentials.PersistenceProvider

    threw unexpected exception at create EntityManagerFactory:


    javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build

    b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException

    Exception Description: predeploy for PersistenceUnit [WebApplication3PU] failed.

    Internal Exception: javax.persistence.PersistenceException: Exception [TOPLINK-28010] (Oracle TopLink

    Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManager


    Exception Description: PersistenceUnitInfo WebApplication3PU has transactionType JTA, but doesnt have


    at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl


    at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider


    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)

    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)

    at org.apache.jsp.CustomerData_jsp._jspService(CustomerData_jsp.java from :54)

    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)

    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)

    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)

    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)

    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317




    I couldnot make out where the error could be...

  • Arun Gupta Thursday, November 1, 2007

    Seems like your persistence unit is not properly configured. Can you try verifying your persistence unit for a simple application as described at: http://blogs.sun.com/arungupta/entry/hello_jpa_world

  • Anja Friday, November 2, 2007

    Hi, the value does not remove from database and the delete.jsp is empty. Is it my fault? best regards Anja

  • Charles Anderson Friday, November 2, 2007

    I'm having the same problem with the delete. It looks like the doAjax call was not being executed, but I think the real problem is that the onSelect is not getting the message from the dataTable.

    glue.js : onSelect request from: undefined value=undefined

    Also step 8 says 'Dojo Editable Table' but the widget added is a from yahoo:

    a:widget name="yahoo.dataTable"

  • Charles Anderson Friday, November 2, 2007

    I changed from a yahoo table to a dojo table and it works.

    Right now I have

    <div id="content" style="height:400px">

    <a:widget name="yahoo.dataTable" service="data.jsp" subscribe="/jmaki/table"/>

    <a:widget name="dojo.table" service="data.jsp" subscribe="/jmaki/table"/>


    If I click on the dojo table everything works, the row is removed from both tables. If I click on the yahoo table, I see this:

    Publish Match : : Topic: /yahoo/dataTable/onSelect listener {topic : '\*onSelect' , target : {functionHandler : function (args) { jmaki.doAjax({method:"POST", url:"delete.jsp?isbn=" + encodeURIComponent(args.value.isbn), callback:function (req) {jmaki.publish("/jmaki/table/removeRow", {targetId:args.value.isbn});}}); jmaki.log("glue.js : onSelect request from: " + args.id + " value=" + args.value); }} , action : 'call' , id : 'jmk_2'}

    in the jMaki logger, but nothing is executed. Click on dojo table, same log entry, but then

    glue.js : onSelect request from: undefined value=[object Object]

    Publish : Topic: /jmaki/table/removeRow message {targetId : 'ABC008'}

    when they are executed.

  • Anja Friday, November 2, 2007

    Hi, it doesn't work with a dojo.table too.

  • Arun Gupta Sunday, November 4, 2007

    I fixed the typo in Step 8. I tried the exact same sample with Dojo Data Table and it worked for me. Can you confirm you are using the latest plugin as opposed to 1.0 ? Where are you downloading it from ?


  • Anja Monday, November 5, 2007

    Hi, sorry it was my fault, it works. I've put the expression in the glue.js not in onSelect.

    Thank you, it works now.

    Have I put an insert clause for the insert in the Books.java and how looks it like.

  • Sekar Monday, November 5, 2007

    Hi Arun,

    I tried to follow the steps as ooutlined. I am running NB6Beta2 with JDK1.6 (bundled with it). I have a class mis match for Books.class. Can you please help me to resolve this?

    [javac] C:/Program Files/glassfish-v2-b53/domains/domain1/generated/jsp/j2ee-modules/jmaki-database

    /org/apache/jsp/data_jsp.java:7: cannot access server.Books

    PWC6199: Generated servlet error:

    [javac] bad class file: C:\\Documents and Settings\\rkayamboo\\Desktop\\jmaki-database\\build\\web\\WEB-INF


    [javac] class file has wrong version 50.0, should be 49.0

    [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.

    [javac] import server.Books;

    [javac] \^

    [javac] 1 error

  • Arun Gupta Monday, November 5, 2007

    Seems like the class file is compiled with Java SE 6 and GlassFish is using Java SE 5. Can you please check ?

  • Sekar Monday, November 5, 2007


    I was able to get past that. The issue was with the GF server on NB6. Though I installed the GFV58b bundled with NB6, the server was pointing to GFV53 (bundled with NB5.5). I think this happened when I imported the settings from NB5.5. Thank you so much Arun for the tutorial and your response.


  • Charles Anderson Tuesday, November 6, 2007

    I'm using JMaki 1.6.11 that came with netbeans 6 beta 2. I show no updates for it in the plugins, so I downloaded the latest from the link before step 1, and it was the same 1.6.11. Still doesn't work with the yahoo dataTable, just dojo.

  • Arun Gupta Tuesday, November 6, 2007

    Sorry about the trouble. I'll create a screencast showing these steps and hopefully that will clarify the steps.

  • Arun Gupta's Blog Thursday, November 8, 2007
    [Trackback] This screencast shows how to create a simple jMaki application, using NetBeans IDE, that performs some of the CRUD operations on a Data Table widget. It uses Java Persistence API (JPA) to connect to the database and the application...
  • Arun Gupta Thursday, November 8, 2007
  • Jonathan Wilcox Tuesday, November 13, 2007

    I get the same result as Charles. Yahoo table does not respond, dojo table works as demonstrated. I'm using Netbeans 6.0 Beta 1 and jmaki plugin 1.6.11

  • Arun Gupta Tuesday, November 13, 2007
  • Raffaele Favilli Sunday, November 18, 2007

    Hi Arun,

    great example! The delete section works but I had to substitute in glue.js args.value.isbn with args.targetId; probably you understand why ... Thank you very much, Raffaele.

    P.S. Every other sample on database management (add rows, filter rows, display tooltips etc.) will be very appreciated!

  • Stephen Howells Sunday, November 25, 2007

    Hi Arun, I am a beginner and tried to implement your example using tomcat rather than glassfish. When I create the persistence unit I do not have the javax.persistence library so it wont compile. Is this because I must use glassfish or can I include the library from somewhere.

    Thanks in advance!

  • Arun Gupta Sunday, November 25, 2007

    A stand-alone persistence library can also be downloaded from https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html. The Persistence library used in GlassFish v2 final build is linked from:


  • Stephen Howells Tuesday, November 27, 2007

    Arun, many thanks again for your replies. I did as you suggested but despite adding the jar file to the Netbeans project libraries the generated class file fails to compile due to non recognition of all the lines that start





    It says it can't find each symbol. I presume that means the compiler still cannot use the library.

    I have added the line

    import javax.persistence.\*;

    Any hints? Sorry in advance for the dumb questions.


  • Anja Wednesday, January 2, 2008

    Thank you for your good example, but it doesn't work for an insert into a database.

    Have you an example for an insert new rows from an data.table into a database, please?

  • Arun Gupta Wednesday, January 2, 2008

    Stephen, I added toplink-essentials.jar and toplink-essentials-agent.jar from the standalone GlassFish Persistence installer in my web application and could compile the classes fine. I tried on Tomcat 6.0.13. And make sure you click on "Add JAR/Folder" in Libraries tab.

  • Arun Gupta Wednesday, January 2, 2008

    Anja, For insert, you'll need to add a HTML form with a text box, read the value from the box and then pass it on to insert.jsp. Have you tried this and it did not work ?


  • Anja Thursday, January 3, 2008

    please can you give me a little example for these problem, it doesn't work. thank you so much

  • Ingemar Friday, January 4, 2008

    nothing showing up from data.jsp

    regards, i

  • Arun Gupta Friday, January 4, 2008

    Ingemar, do you see any errors in the GlassFish console ?

  • Ingemar Saturday, January 5, 2008

    Hello Arun,

    Thanks for the swift reply to my short comment.

    Can give you my environment first:

    glassfish-v2-b58g (standalone, not bundled with netbeans).

    Java version "1.6.0_03" ( did upgrade from jdk1.5.0_12 , thought that might help me out ).

    Running latest Netbeans ( NetBeans IDE 6.0 (Build 200711261600) ).

    Using ajax Jmakik support 1.6.13.

    The glassfish console ends with the following:

    SMGT0007: Self Management Rules service is enabled

    Application server startup complete.

    deployed with moduleid = Svemab

    [TopLink Info]: 2008.01.05 02:25:19.705--ServerSession(28732011)--TopLink, version: Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))

    [TopLink Info]: 2008.01.05 02:25:22.004--ServerSession(28732011)--file:/C:/Users/ing/Documents/NetBeansProjects/Svemab/build/web/WEB-INF/classes/-SvemabPU login successful

    - so I hade to add the following in my persistence.xml


    At first I thought the the index.jsp did not find the data.jsp - but it is probably, because it complained at first at my faulty written @NamedQuery - now it is not complaing about that.

    my index.jsp has the follwoing:

    <div id="content" style="height:400px">

    <a:widget name="yahoo.dataTable" service="data.jsp" subscribe="/jmaki/table"/>

    <a:widget name="dojo.table" service="data.jsp" subscribe="/jmaki/table"/>


    but it is not showing anything from my data.jsp.

    Hope that you can give me a hand.

    regards, Ingemar

    regards, i

  • ingmar Tuesday, January 8, 2008

    Hello arun,

    Can you see what my trouble is?

    regards, i


    eager to get started

  • Arun Gupta's Blog Thursday, January 24, 2008
    [Trackback] &quot;sakila&quot; is the sample database shipped with MySQL (pronounced as my ess-kew-ell). In the context of Sun Microsystems announcing the agreement to acquire MySQL, I'd like to dedicate this entry to show how this sample database can be exposed a...
  • Arun Gupta's Blog Thursday, January 24, 2008
    [Trackback] &quot;sakila&quot; is the sample database shipped with MySQL (pronounced as my ess-kew-ell). In the context of Sun Microsystems announcing the agreement to acquire MySQL, I'd like to dedicate this entry to show how this sample database can be exposed a...
  • ingemar Friday, January 25, 2008

    Hello Arun.

    Do not understand your latest 'trackback'.

    Did you have some kind of answer for me ?

    regards, i

  • David Costelloe Wednesday, January 30, 2008

    I am loading a jmaki combobox from the database here is the code for the page:


    EntityManagerFactory emf = Persistence.createEntityManagerFactory("wprjSonicWebMonitorPU");

    EntityManager em = emf.createEntityManager();

    List<Sonicinfo> list = em.createNamedQuery("server.getProfiles").getResultList();

    out.println("{value : [" +

    "{ label : 'profile', value : 'id'}" + "]");

    for (int i = 0; i < list.size(); i++)


    Sonicinfo b = list.get(i);

    out.print("{ id: '" + b.getEventid() + "'" + "' - '" + "'" + "profile: '" + b.getConnectionname() + "'}");


    out.println("] }");


    For some reason I can't seem to populate the combobox?


  • Anja Friday, February 1, 2008

    Hi David Costelloe-

    your JSON Array isn't correct


    EntityManagerFactory emf = Persistence.createEntityManagerFactory("buchportalPU");

    EntityManager em = emf.createEntityManager();

    List<Bestseller> list = em.createNamedQuery("Bestseller.findAll").getResultList();

    out.println("value= [");

    for (int i=0; i<list.size(); i++) {

    Bestseller b = list.get(i);

    out.print("{label : '" + b.getAutor() + "'" + "," + " value : '" + b.getTitel() + "'}");

    if (i < list.size()-1)





    Try this - it works.

    best regards Anja

  • Miguel Pereira Tuesday, February 12, 2008

    I am triing to update the table from information I get from a form with 3 parameters.

    I can't seem to make the table update after the query. In firebug I can see that the information is retrieved from the database:

    {columns : [{ label : 'Consumo PVB ID', id : 'conspvbid'},{ label :'Cliente', id : 'cliente'},{ label

    :'Produção ID', id : 'producaoid'},{ label :'Tipo PVB', id : 'tipopvb'},{ label :'Quantidade(m2)', id

    : 'quantidade'},{ label :'Data', id : 'datacorte'},{ label :'Tipo PVB ID', id : 'tipopvbid'},{ label

    :'Rolo PVB ID', id : 'chapaid'}],

    rows: [

    { conspvbid: '1',cliente: 'VIMARTINS - SOCIEDADE TRANSFORMADORA DE VIDRO, LDA',producaoid: '2007110001'

    ,tipopvb: '0,38 Translucido',quantidade: '35',datacorte: '2007-12-27',tipopvbid: '1',chapaid: '1'}

    ] }

    However, the table doesn't update. I think it is partially because the form has the return false statement:

    <form method="POST" onSubmit="doAjaxSubmit();return false;" action='conspvbclientetipodata.jsp' >

    If i take off the return false it doesnt work.

    The doAjaxSubmit() method is:

    function doAjaxSubmit() {

    var selectedCliente = jmaki.getWidget('clienteac').getValue();

    var selectedTipoPVB = jmaki.getWidget('tipopvbac').getValue();

    var selectedDataInicio = jmaki.getWidget('datainicio').getValue();

    var selectedDataFim = jmaki.getWidget('datafim').getValue();

    jmaki.log("Cliente:" + selectedCliente);

    jmaki.log("Tipo PVB:" + selectedTipoPVB);

    jmaki.log("Data Inicio:" + selectedDataInicio);

    jmaki.log("Data Fim:" + selectedDataFim);

    // now post this form data

    jmaki.doAjax({ url : "dataconspvbclientetipodata.jsp",

    method : 'POST',

    content : { cliente : selectedCliente,

    tipopvb : selectedTipoPVB,

    datainicio : selectedDataInicio,

    datafim : selectedDataFim},

    callback: function(_req) {

    jmaki.publish('/jmaki/table/updateRow', { targetId: "bar" });




    Can I get any help on this. How can I make the page reload after the query.

  • guest Sunday, April 13, 2008


  • Jonathan Maher Friday, April 18, 2008

    I'm with Anja, how do you reload a dataTable from glue?

  • yadi Friday, April 18, 2008

    hi, please help me , when i choice new row and parameter isbn passed , i want to go other page - in other words , when click the row goto other page . thanks.

  • Anja Friday, April 18, 2008


    sometimes you have to clear the table - cache for visiting the new data in the table. So you have to put this in your persistence.xml :


    <property name="toplink.cache.shared.tablename1" value="false"/>

    <property name="toplink.cache.shared.tablename2" value="false"/> ....


    Please can you post you glue.js for the table an specify your question?

  • Anja Friday, April 18, 2008

    the last comment is for Jonathan Maher

  • Jonathan Tuesday, April 22, 2008

    Thanks Anja, I just thought there was a simple Javascript or jMaki call that reloaded a dataTable if the service attribute value was a jsp page which returned columns and rows of JSON. I removed the service attribute/value and added the columns to the value attribute and returned the JSON rows via a bean. I can now clear and add rows as follows:

    jmaki.publish("/yahoo/dataTable/master/clear", { });

    jmaki.publish("/yahoo/dataTable/master/addRows", {value : objData });

  • Natalia Wednesday, July 16, 2008

    Hi, I have a problem when I try to delete, I get in Firebug the error:

    "java.lang.IllegalArgumentException: NamedQuery of name: Books.deleteByIsbn not found"

    But the query is there and I know that my PU it's working fine because I don't have any problems with data.jsp.

    I have a Books.java with the named query

    @NamedQuery(name = "Books.deleteByIsbn", query = "DELETE FROM Books b WHERE b.isbn = :isbn")

    and my delete.jsp looks like this


    String isbn = request.getParameter("isbn");

    EntityManagerFactory emf = Persistence.createEntityManagerFactory("booksPU");

    EntityManager em = emf.createEntityManager();


    em.createNamedQuery("Books.deleteByIsbn").setParameter("isbn", isbn).executeUpdate();



    what am I doing wrong?

  • manuel Thursday, September 18, 2008

    nobody know resolve this error, I use J2EE, Jmaki and glasfish v2:

    Failed to load data: doAjax error communicating with data.jsp. Server returned status code 500.


  • Rambo Monday, October 6, 2008

    sample works like a champ with both yahoo.datatable and dojo.table ... no issues!

    good job arun

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.