Solved

refresh the jsp page

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

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

724 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