package com.gai.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.gai.common.DataBase;
import com.gai.common.Query;
import com.gai.common.Update;
public class Checkout extends HttpServlet {
/**
* Constructor of the object.
*/
public Checkout() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doPost(request, response);
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
String name = request.getParameter("name");
String addr = request.getParameter("addr");
String zip = request.getParameter("zip");
String tel = request.getParameter("tel");
String mov = request.getParameter("mov");
double price = Double.parseDouble(request.getParameter("price"));
//String email = request.getParameter("email");
String bz = request.getParameter("bz");
DataBase db = new DataBase();
String sql = "insert into foodOrderInfo (customerName,address,zipCode,telephone,movePhone,notice,totalPrice) values(?,?,?,?,?,?,?)";
System.out.print(sql+"...................................................................");
Update up = db.update(sql);
up.setString(1, name);
up.setString(2, zip);
up.setString(3, addr);
up.setString(4, mov);
up.setString(5, tel);
up.setString(6, bz);
up.setDouble(7, price);
int row = up.execute();
if(row == 1)
{
System.out.print(sql+".....2222..............................................................");
request.getRequestDispatcher("end.jsp").forward(request, response);
}
else
{
System.out.print(sql+".....else..............................................................");
}
} catch (SQLException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
//query.setString(1, email);
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException {
// Put your code here
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
网上订餐-初始版-jsp
共118个文件
jpg:22个
java:18个
class:18个
需积分: 0 9 下载量 123 浏览量
2008-08-29
11:21:59
上传
评论
收藏 1.36MB RAR 举报
温馨提示
用到标签,没有<%%>,操作数据库,分页的实现
资源详情
资源评论
资源推荐
收起资源包目录
网上订餐-初始版-jsp (118个子文件)
FindFoodDao.class 3KB
FindFoodasId.class 3KB
Checkout.class 3KB
AddFoodToCart.class 3KB
LoginCheck.class 3KB
ShowServlet.class 2KB
Page.class 2KB
deServlet.class 2KB
DataBase.class 2KB
filterShow.class 2KB
Foods.class 1KB
Userdao.class 1KB
allfilter.class 1KB
Statement.class 1KB
DeFood.class 1KB
Cart.class 891B
Query.class 718B
Update.class 659B
.classpath 478B
Main.css 222B
Thumbs.db 120KB
tp009.gif 5KB
insider_cn.gif 2KB
link_cn.gif 2KB
dynamic_cn.gif 2KB
lcart_cn.gif 2KB
buy_cn.gif 1KB
detail_cn.gif 1KB
0.gif 575B
2.gif 574B
5.gif 563B
001.gif 129B
002.gif 65B
004.gif 59B
005.gif 57B
003.gif 52B
MyHtml.html 482B
standard.jar 384KB
jstl.jar 20KB
Checkout.java 3KB
FindFoodDao.java 3KB
LoginCheck.java 3KB
AddFoodToCart.java 3KB
ShowServlet.java 3KB
deServlet.java 2KB
FindFoodasId.java 2KB
Page.java 2KB
DataBase.java 1KB
Foods.java 1KB
filterShow.java 1010B
Statement.java 895B
allfilter.java 799B
Userdao.java 572B
Cart.java 471B
DeFood.java 443B
Update.java 428B
Query.java 398B
left_top.jpg 337KB
500044.jpg 47KB
500033.jpg 39KB
500045.jpg 28KB
500043.jpg 18KB
500008.jpg 18KB
500023.jpg 18KB
500036.jpg 17KB
500025.jpg 17KB
002.jpg 17KB
500026.jpg 15KB
500034.jpg 14KB
500038.jpg 14KB
500024.jpg 12KB
500042.jpg 12KB
500047.jpg 11KB
500035.jpg 11KB
001.jpg 11KB
500041.jpg 10KB
500022.jpg 9KB
jb_logo.jpg 4KB
500046.jpg 4KB
checkOut.jsp 6KB
Show.jsp 3KB
Cart.jsp 3KB
Description.jsp 3KB
Login.jsp 3KB
code.jsp 2KB
end.jsp 2KB
top.jsp 1KB
right.jsp 915B
left.jsp 913B
bottom.jsp 841B
error.jsp 832B
MANIFEST.MF 39B
.mymetadata 298B
.myumldata 66B
org.eclipse.wst.validation.prefs 1KB
com.genuitec.eclipse.j2eedt.core.prefs 1KB
org.eclipse.jdt.core.prefs 629B
com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs 120B
org.eclipse.core.resources.prefs 88B
.project 1KB
共 118 条
- 1
- 2
wanggaina666
- 粉丝: 5
- 资源: 32
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0