Solved

refresh the jsp page

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 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

20 Experts available now in Live!

Get 1:1 Help Now