Solved

refresh the jsp page

Posted on 2004-04-16
3
238 Views
Last Modified: 2010-03-04
I am now doing my project. I am doing the chief part. The chief's jsp page will display the menu table include column(itemID,name,quantity).  The chief is able to view the jsp page which will refresh  whenever there is any updated column, quantity from the database(done by another member which will insert the quantity when people want any order)
Finally once the chief have finish cooking, the chief will click on the minus button to minus off the quantity from the database column.

Therefore i need help for the coding on

1) refresh jsp page whenever there is any updated quantity in the column from the database.

2) minus button use to minus no. of quantity from the database

Thank You!!!
0
Comment
Question by:YvonneYap
3 Comments
 
LVL 13

Accepted Solution

by:
copyPasteGhost earned 250 total points
Comment Utility
you want the jsp page to refresh when the columun updates?
I don't think you can do that..
the code for the minus would be something like this..The id will be a unique value of the order maybe order number or something

<form action="process.jsp?id=12342" method="post">
<input type="submit" value="Minus" />
</form>


process.jsp
<%
String id = request.getParameter("id");
//Open connection to the database
String sqlQuery1 = "Select quantity from table_name where quantity='" + id + "'";
rs = stat.exectueQuery(sqlQuery1);

if(rs.next()) {
    int qty = rs.getInt("quantity");
    String sqlQuery2 = "Update table_name set quantity='" + (qty - 1) +"'";
    int result = stat.executeUpdate(sqlQuery2);
}
%>

Cheers,
Ghost
0
 
LVL 15

Expert Comment

by:periwinkle
Comment Utility
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

   ACCEPT: copyPasteGhost

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Periwinkle
EE Cleanup Volunteer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now