Solved

refresh the jsp page

Posted on 2004-04-16
3
240 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
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

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 …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

772 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