This Domain(Admin5.com) is for Sale:

全面解析JDBC

时间:2007-10-22  来源:不详  作者:林子

else whereClause = " where good_name=" "'" queryName "'";
}

}
if (queryRequest.equals("3")){
whichCB = "ck_sjcg";
whichTable = "sjcg_table";
queryNo = request.getParameter("ed_sjcg_no");
queryName = request.getParameter("ed_sjcg_name");
if (!queryNo.equals(""))
whereClause = " where good_no=" "'" queryNo "'";
if (!queryName.equals("")){
if (!queryNo.equals(""))
whereClause = " and good_name=" "'" queryName "'";
else whereClause = " where good_name=" "'" queryName "'";
}

}
String[] printTitle = request.getParameterValues(whichCB);

%>
<!--create query sql statement-->
<%
sqlStatement = "select ";
for(int i = 0;i<printTitle.length;i ){
sqlField = printTitle[i] ",";
}
sqlStatement = sqlField.substring(0,sqlField.length()-1) " from " whichTable;
if (!whereClause.equals(""))
sqlStatement = whereClause;
%>
<!--show query response--> 本文来自织梦
<%
try{
DBBean.query(sqlStatement);
}catch(Exception e){
out.println("Database Error!");
}
int rows = DBBean.getRowcount();
int cols = DBBean.getColumncount();
%>
<Table align="center" width="80%" border=1>
<tr align=center>
<%
for(int i = 0;i < printTitle.length;i ){
out.println("<td><b>");
out.println(printTitle[i]);
out.println("</b></td>");
}
%>
</tr>
<%
for (int i = 0;i < rows;i ){
out.println("<tr>");
for (int j = 0;j < cols;j )
out.println("<td>" DBBean.get(i,j) "</td>");
out.println("</tr>");
}
%>
</Table>
<br>
<hr>
<a href="demo_main.htm">Click here to return</a></p>
</body>
</html>
dedecms.com

  ③ 生成实际采购表

  生成数据库表是一个隐式操作,程序根据计划采购表和库存统计表的相应字段生成实际采购表,不需要用户的任何输入,其功能代码如下(demo_create.jsp):

看完这篇,您有何感觉呢?

上一篇:jsp入门学习教程   下一篇:JSP漏洞大观

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息