<%--
Document
: update2
Created on : 2010-3-31, 22:29:08
Author
: linyan
--%>
<%@page contentType="text/html" pageEncoding="gbk"%>
<%@page language="java" import="java.util.*"%>
<%@page import="java.sql.*"%>
<%@page import="myjsp.Select"%>
<%@page import="myjsp.test"%>
<jsp:useBean id="xxx" scope="session" class="myjsp.Conn"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.
<html>
<head>
<title>bb1.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=gbk">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
</head>
<body>
<%
request.setCharacterEncoding("GB2312");;
String name[]=request.getParameterValues("name");
// String d=request.getParameter("AllData[hh++]");
// out.print(d);
%>
<%
String id=request.getParameter("id");
String lie=request.getParameter("lie");
String tableid=request.getParameter("tableid");
%>
<%
//String tt=request.getParameter("tian");
//out.print(tt);
%>
<%
Select conn1=new Select();
String strSql1="select * from "+id+" where "+lie+"="+tableid+"";
ResultSet rs1=conn1.doQuery(strSql1);
%>
<%
Select conn=new Select();
String strid=request.getParameter("id");
String strSql="select * from "+strid+"";
ResultSet rs=conn.doQuery(strSql);
%>
<%
String[] AllData=conn.DB2(rs);
ResultSetMetaData rsmd = rs.getMetaData();
int aa=rsmd.getColumnCount();%>
<%for(int hh=0;hh<aa;hh++){%>
<%=AllData[hh]+"="%>
<% for(int i=0;i<name.length;i++){%>
<%if(i==hh){%>
<%="'"+name[i]+"'"+","%>
<%
break;}%>
<%}%>
<%}%>
</body>
</html>
现在的输出结果为:
yunhuoshangID= '3', gongsimingcheng= '联邦货运', dianhua= '(010) 65559931',
我要让最后一个字符没有也就是说没有那个逗号。
之后我要把它传递成字符串,帮忙啦!