Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8518431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:58:33+00:00 2026-06-11T05:58:33+00:00

@Named(value = viewtable) @ManagedBean @ViewScoped public final class viewtable implements Serializable { ArrayList<viewbean> dlist

  • 0
@Named(value = "viewtable")
@ManagedBean
@ViewScoped
public final class viewtable implements Serializable {

    ArrayList<viewbean> dlist = new ArrayList<viewbean>();
    ArrayList<Master> mlist = new ArrayList<Master>();


    public ArrayList<viewbean> 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-> "+ex);
        }
    }

    public void onEdit(RowEditEvent event) {
    }
}

The above code didn’t update the data in the database in the get() method I’ve done any error and how to connect with the database using PrimeFaces.
I used a managed bean for save details from the database as a list called mlist.

JSF:

<h:form id="dtform">
    <p:growl showDetail="true" id="mess"/>
    <p:dataTable id="dt1" scrollable="true" scrollWidth="700" var="mas"  value="#{viewtable.dlist}" editable="true">
        <f:facet name="header">
            Edit Here
        </f:facet>
        <p:column headerText="Regno" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText  value="#{mas.regno}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.regno}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Rollno" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.rollno}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.rollno}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Firstname" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.fname}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.fname}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Lastname" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.lname}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.lname}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="D.O.B" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.dob}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.dob}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Address" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.address}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.address}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Avatar" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.avatar}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.avatar}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Email" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.email}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.email}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Phno" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.phno}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.phno}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Dept" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.dept}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.dept}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Year" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.year}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.year}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Start" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.inidate}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.inidate}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="End" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.enddate}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.enddate}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Remarks" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.remarks}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.remarks}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Delivery" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.delivery}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.delivery}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Message" width="100">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{mas.messdelivery}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{mas.messdelivery}"/>
                </f:facet>
            </p:cellEditor>
        </p:column>
        <p:column headerText="Options" width="100">
            <p:rowEditor/>
        </p:column>
        <p:ajax event="rowEdit" listener="#{viewtable.onEdit}" update=":dtform:mess"/>
    </p:dataTable>
</h:form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:58:34+00:00Added an answer on June 11, 2026 at 5:58 am

    I assume you have configured hibernate in your environment, and mapped your database to an entity class. you can update the records accordingly.

    You can access the rows and update the records like :

        public void onEdit(RowEditEvent event) {  
                YourHibernateEntity yourEntity = (YourHibernateEntity ) event.getObject());  
                SessionFactory sessFact = new AnnotationConfiguration().configure().buildSessionFactory();    
            Session sess = sessFact.openSession();
            Transaction  tran = sess.beginTransaction();
            sess.update(yourEntity );
            tran.commit();      
    
            } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my ManagedBean: @Named(value = mrBean) @RequestScoped public class MrBean { public void
I have two beans. First bean languageOfSystem: @Named(value = languageOfSystem) @SessionScoped public class LanguageOfSystem
In my application, I have the following beans: @Named(value = mrBean) @SessionScoped public class
#include<iostream> using namespace std; class A { private: int value; public: A(int init):value(init){} void
I have a bunch of named value parameters in a Dictionary<string, object> , which
Iam trying to use a UserControl named CheckBoxControl as value for the ExpandControlID/CollapseControlID attributes
a function named getTimerInterval returned a NSTimerInterval value -(NSTimeInterval *)getInterval { NSTimeInterval interval =
data table contain column named as Fld_primary. this column contain value like 0.00 it
I'm currently using the TextBlock below to bind the value of a property named
I have a WPF ComboBox named cbFileSize. I try to get is selected value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.