File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Head First Android
this week in the
Joined: Jul 20, 2009
Aug 01, 2009 01:29:18
i am fresher in
and i can work on one project and that project client requirement is that when we enter any value in text box that value store in database and it display that page below
I use Netbeans and for mysql and i write this code
it is java file
staffList = new
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
Query query = session.createQuery(SQL_QUERY);
staffList = (
for(Iterator it = query.iterate(); it.hasNext();)
Object row = it.next();
this code is
<workCategory> workType = objallFunction.getAllStaffInfo_work();
for (workCategory workCat : workType)
<input type="hidden" name="hdnStaffType"/>
<td><input type="button" id="btnedit" name="btnedit" value="Edit"/></td>
<td><input type="button" id="btndelete" name="btndelete" value="Delete"/></td>
above code is run successfully but all data store in database 1 time and display in page 2 time or multiple times same data but actually that data is store 1 time.
so please help and give write code ya give another code.
Joined: Oct 13, 2005
Aug 01, 2009 03:57:25
You don't appear to use a database at all in that code. That doesn't look like beginner's code, so I shall move you to the JSP forum. And your code is difficult to read if you don't use the
Joined: Jan 28, 2008
Aug 01, 2009 06:05:46
jsp is far away from hibernate,since we do not know about hibernate
Joined: Sep 29, 2008
Aug 01, 2009 06:31:32
The query already returns a list; why do you do anything w/ the query and staffList after query.list()???
I agree. Here's the link:
h:panelGrid + ui:repeat tag issue
How do I pass a variable from one jsp to another?
Edit/Delete values in database using jsp
How to update a image using servlet?
struts 2 + dynamic input + showing said input
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015