Solved

refresh the jsp page

Posted on 2004-04-16
3
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Accepted Solution

by:
copyPasteGhost earned 250 total points
ID: 10973394
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
ID: 11761177
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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 …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 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