请问jsp连接数据库问题
lola 2003-07-18 09:45:06 我在menu.jsp里面,通过 parent.data.location.href = "data.jsp?id=" id;来连接data.jsp显示数据页面
在data.jsp里通过
<jsp:useBean id="testdb" scope="page" class="dbuser.dbmgr"/>
<%
String id=request.getParameter("id");
try{
testdb.connect();
String s = "select * from budget where budget_code like '" + id + "%' order by budget_code";
testdb.query(s);
%>
<table width="100%" height="18" border="1" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<%
while(testdb.next())
{
%>
<tr align="center" bgcolor="#C8E2FF">
<%
for(int j = 1;j<7;j++)
{%>
<td width="160" height="18"><font size="2"><%=testdb.getString(j)%></font></td>
<%}%>
</tr>
<%}%>
</table>
<%
testdb.close();
}
catch(Exception e)
{
out.println(e);
}
%>
来显示数据.为什么没有结果显示呢