import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Ordercheck extends HttpServlet {
private static final long serialVersionUID = 310954312878527046L;
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
response.setCharacterEncoding("gb2312");
PrintWriter out = response.getWriter();
request.setCharacterEncoding("gb2312");
String school=request.getParameter("school");
request.setAttribute("学校", school);
String sno=request.getParameter("sno");
request.setAttribute("学号",sno);
String trainno=request.getParameter("tno");
request.setAttribute("车次号", trainno);
String kind=request.getParameter("kind");
request.setAttribute("种类", kind);
OperateDb orderjudge=new OperateDb();
String sqlprice=null;
//查询单价一边插入数据
if(kind.equals("硬座"))
{
sqlprice="select thseat from train where tno="+ "\'"+trainno+"\'";
}
else
{
sqlprice="select tsseat from train where tno="+ "\'"+trainno+"\'";
}
ResultSet rsprice=orderjudge.query(sqlprice);
try {
rsprice.next();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//'''''''''''''''''''''''''''''''''
String scount=request.getParameter("count");
int count=Integer.parseInt(scount);
request.setAttribute("票数", scount);
//查询余票。。。。。。。。。。。。。。
String sqlselect="select trest from train where tno="+ "\'"+trainno+"\'";
ResultSet rs=orderjudge.query(sqlselect);
int rest=0 ;
try {
上一页 [1] [2] [3] [4] [5] [6] 下一页