网站建设资讯

NEWS

网站建设资讯

JSP(12)-商品处理模块

该模块基本上为 进货模块(http://blog.itpub.net/post/334/32287)的反过程。[@more@]

dispose_bef.jsp:

创新互联从2013年成立,是专业互联网技术服务公司,拥有项目成都网站建设、网站设计网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元香格里拉做网站,已为上家服务,为香格里拉各地企业和个人服务,联系电话:028-86922220

<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.text.DateFormat" %>
<%
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader("Expires", 0); //prevents caching at the proxy server

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
java.util.Date d=new java.util.Date();
DateFormat dFormat=new SimpleDateFormat("yyyy-MM-dd",Locale.CHINESE);

String sExchId = request.getParameter("exch_id");
String sExchName = "";
String sExchUnit = "";
String sExchQutt = "";

String sCommQutt = request.getParameter("exch_qutt");

boolean rsnull=true;

if(sExchId != null && !sExchId.equals("")){

Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@TCSCH074.tcsgdccn.com:1521:orcl";
//orcl为你的数据库的SID
String user="store";
String password="store";
Connection conn= DriverManager.getConnection(url,user,password);
String sQuery = null;
Statement stmt = null;
ResultSet rs = null;

try{

sQuery = "select comm_name, comm_unit, comm_qutt from commodity ";
sQuery = sQuery + " where comm_id='"+sExchId+"'";

stmt = conn.createStatement();
rs = stmt.executeQuery(sQuery);

while(rs.next())
{
rsnull=false;
sExchName = rs.getString("comm_name");
sExchUnit = rs.getString("comm_unit");
sExchQutt = rs.getString("comm_qutt");
}

}
catch(Exception e){
System.out.println("检索商品信息时出错!");
e.printStackTrace();
out.println("

检索商品信息时出错!请联系技术支持人员。

");
out.println( e.getMessage() );
out.println("");
}
finally{
if(stmt != null) stmt.close();
conn.close();
}
}
%>





进货