| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 517 人关注过本帖
标题:用JSP编写的一个WEB页面,在resin中不能显示出效果,请大家指教一下,问题出 ...
只看楼主 加入收藏
jinhaozhu
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-5-13
收藏
 问题点数:0 回复次数:0 
用JSP编写的一个WEB页面,在resin中不能显示出效果,请大家指教一下,问题出在哪了

<%@ page contentType="text/html; charset=GB2312" %>
<%@ page import="bean.*,java.util.*,java.sql.*"%>
<%
request.setCharacterEncoding("GB2312");

String url="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=F:\\java\\resin-3.0.8

\\resin-3.0.8\\webapps\\bookshop\\bookshoplk.mdb";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:bookshoplk","sa","");
Statement stmt=conn.createStatement

(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs=null;
rs=stmt.executeQuery("select orderid from orderform ");
rs.next();
String s_orderid=rs.getInt(1)+1+"";
String s_userid=(String) request.getParameter("userid");
String s_payment=(String) request.getParameter("payment");
String s_deliver=(String) request.getParameter("deliver");
String s_receiver=(String) request.getParameter("receiver");
String s_address=(String) request.getParameter("address");
String s_phone=(String) request.getParameter("phone");
String s_postcode=(String) request.getParameter("postcode");
int i_totalnum=0;
double d_totalamount=0.0;
Iterator it=null;
Collection c_cart=(Collection)session.getAttribute("cart");

if(c_cart==null)
{
out.println("不能重复下订单!");
return;
}
Calendar getdate=Calendar.getInstance();
it=c_cart.iterator();
while(it.hasNext()){
cartBean cbean=(cartBean)(it.next());
i_totalnum+=cbean.ordernum;
d_totalamount+=cbean.subtotal;
stmt.executeUpdate("insert into orderdetail

(orderid,bookid,bookname,publisher,unitprice,ordernum) values

('"+s_orderid+"','"+cbean.bookid+"','"+cbean.bookname+"','"+cbean.publish+"','"+cbean.unitprice+"','"+

cbean.ordernum+"')");
}
String s_sql="insert into orderform

(orderid,orderdate,userid,totalnum,totalamount,payment,deliver,receiver,address,phone,postcode,sta

te) "+
"values

('"+s_orderid+"',getdate,'"+s_userid+"','"+i_totalnum+"','"+d_totalamount+"','"+s_payment+"','"+s_deliver

+"','"+s_receiver+"','"+s_address+"','"+s_phone+"','"+s_postcode+"','0')" ;
stmt.executeUpdate(s_sql);
%>
<link href="maincss.css" rel="stylesheet" type="text/css">
<div align="center">
<%@include file="top.jsp" %>
<table width="750" border="0" cellspacing="1" cellpadding="1">
<tr>
<td ><div align="center"></div></td>
</tr>
<tr>
<td ><div align="center"><table width="100%" border="0" cellpadding="1" cellspacing="1" class="td">
<tr>
<td colspan="6">您已经成功下单,下面是您这次订单的购书信息,请记住您订单号,我们的工作人员

会及时与您联系.</td>
</tr>
<tr>
<td colspan="6"><hr size="1" noshade width="100%"></td>
</tr>
<tr>
<td colspan="6"> 订单号:<%=s_orderid%></td>
</tr>
<tr>
<td colspan="2"> 收货人:<%=s_receiver%></td>
<td colspan="2">&nbsp;</td>
<td colspan="2"> 地址:<%=s_address%></td>
</tr>
<tr>
<td colspan="2"> 邮编:<%=s_postcode%></td>
<td colspan="2">&nbsp;</td>
<td colspan="2"> 联系电话:<%=s_phone%></td>
</tr>
<%
i_totalnum=0;
d_totalamount=0.0;
c_cart=(Collection)session.getAttribute("cart");
if(c_cart!=null&&c_cart.size()>0){%>
<tr>
<td>书号</td>
<td>书名</td>
<td>出版社</td>
<td>单价</td>
<td>数量(本)</td>
<td>合价</td>
</tr>
<%
it=c_cart.iterator();
while(it.hasNext()){
cartBean cbean=(cartBean)(it.next());
i_totalnum+=cbean.ordernum;
d_totalamount+=cbean.subtotal;
%>
<tr>
<td height="19"><%=cbean.bookid%></td>
<td><%=cbean.bookname%></td>
<td><%=cbean.publish%></td>
<td>¥<%=cbean.unitprice%></td>
<td><%=cbean.ordernum%>&nbsp;
<td>¥<%=cbean.subtotal%></td>
</tr>
<%
}//while
session.removeAttribute("cart");
%>
<tr>
<td colspan="4"><div align="right">合计</div></td>
<td ><%=i_totalnum%>(本)</td>
<td colspan="2">¥<%=d_totalamount%></td>
</tr>
<tr>
<td colspan="7"> <div align="left">谢谢您的支持! </div></td>
</tr>
<%}%>
</table>
</div></td>
</tr>
<tr>
<td ><div align="center"><%@include file="bottom.jsp" %></div></td>
</tr>
</table>
</div>

编译时显示:java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是
1。
请各位高手指点一下。 万分感谢!

搜索更多相关主题的帖子: resin WEB JSP 效果 页面 
2007-05-13 13:30
快速回复:用JSP编写的一个WEB页面,在resin中不能显示出效果,请大家指教一下, ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016455 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved