title: primefaces in-cell-editing control not update data in database
body: <pre><code>@Named(value = "viewtable")
  @ManagedBean
  @ViewScoped
  public final class viewtable implements Serializable {
  
      ArrayList&lt;viewbean&gt; dlist = new ArrayList&lt;viewbean&gt;();
      ArrayList&lt;Master&gt; mlist = new ArrayList&lt;Master&gt;();
  
  
      public ArrayList&lt;viewbean&gt; getDlist() {
          return dlist;
      }
  
      public viewtable()  {
          get();
      }
  
      public void get() {
          try
          {
              InitialContext ic = new InitialContext();
              DataSource ds = (DataSource) ic.lookup("jdbc/mydsn");
              Connection con = ds.getConnection();
  
              PreparedStatement ps=con.prepareStatement("select * from master");
              ResultSet rs=ps.executeQuery();
  
              while(rs.next())
              {
                  dlist.add(new viewbean(rs.getString(1), rs.getString(2),rs.getString(3),rs.getString(4),rs.getDate(5), rs.getString(6), rs.getBytes(7), rs.getString(8),rs.getString(9),rs.getString(10),rs.getString(11),rs.getDate(12),rs.getDate(13),rs.getString(14),rs.getString(15), rs.getString(16)));
              }
          }catch(Exception ex)
          {
              System.out.println("Conncetion pool db error-&gt; "+ex);
          }
      }
  
      public void onEdit(RowEditEvent event) {
      }
  }
  </code></pre>
  
  <p>The above code didn't update the data in the database in the <code>get()</code> method I've done any error and how to connect with the database using PrimeFaces.<br>
  I used a managed bean for save details from the database as a list called <code>mlist</code>.</p>
  
  <p>JSF:</p>
  
  <pre><code>&lt;h:form id="dtform"&gt;
      &lt;p:growl showDetail="true" id="mess"/&gt;
      &lt;p:dataTable id="dt1" scrollable="true" scrollWidth="700" var="mas"  value="#{viewtable.dlist}" editable="true"&gt;
          &lt;f:facet name="header"&gt;
              Edit Here
          &lt;/f:facet&gt;
          &lt;p:column headerText="Regno" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText  value="#{mas.regno}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.regno}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Rollno" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.rollno}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.rollno}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Firstname" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.fname}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.fname}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Lastname" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.lname}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.lname}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="D.O.B" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.dob}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.dob}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Address" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.address}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.address}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Avatar" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.avatar}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.avatar}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Email" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.email}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.email}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Phno" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.phno}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.phno}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Dept" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.dept}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.dept}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Year" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.year}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.year}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Start" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.inidate}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.inidate}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="End" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.enddate}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.enddate}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Remarks" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.remarks}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.remarks}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Delivery" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.delivery}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.delivery}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Message" width="100"&gt;
              &lt;p:cellEditor&gt;
                  &lt;f:facet name="output"&gt;
                      &lt;h:outputText value="#{mas.messdelivery}"/&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="input"&gt;
                      &lt;p:inputText value="#{mas.messdelivery}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:cellEditor&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Options" width="100"&gt;
              &lt;p:rowEditor/&gt;
          &lt;/p:column&gt;
          &lt;p:ajax event="rowEdit" listener="#{viewtable.onEdit}" update=":dtform:mess"/&gt;
      &lt;/p:dataTable&gt;
  &lt;/h:form&gt;
  </code></pre>