日期:2014-05-18  浏览次数:20813 次

不能第二次访问数据库
<%@   page   language= "java "   import= "java.sql.* "   pageEncoding= "GB18030 "%>
<%request.setCharacterEncoding( "gb2312 ");%>
<html>
  <head>
  </head>
   
  <body   bgColor=#4e7dd1>
<form   action= "webedit.jsp "   method= "post ">
<table   align= "center ">
<tr> <td   align= "center "> <FONT   style= "FONT-SIZE:   15pt "   color=#eff5fa> 后台网络收藏夹管理 </FONT> </td> </tr>
<jsp:useBean   id= "resource "   scope= "page "   class= "sju.sjumis.yuanding.util.TeacherDBBean "> </jsp:useBean>
<%String   address   =   request.getParameter( "webaddress ");
String   name   =   "benwei ";
ResultSet   rs   =   resource.executeQuery( "select   *   from   collectioncontent   where   hrefaddress= ' "+address+ " '   and   username= ' "   +name+ " ' ");
if(rs.next())
{%>
<tr> <td> 网站名称: </td> <td> <input   type= "text "   name= "text1 "   value= <%=rs.getString( "webname ")%> > </td> </tr>
<tr> <td> 网站地址: </td> <td> <input   type= "text "   name= "text2 "   value= <%=rs.getString( "hrefaddress ")%> > </td> </tr>
<tr> <td> 网站名称: </td> <td> <input   type= "text "   name= "text3 "   value= <%=rs.getString( "remark ")%> > </td> </tr>
<tr> <td> <input   type= "hidden "   name= "text4 "   value= <%=rs.getString( "hrefaddress ")%> > </td> </tr>
<%}
else
{%>
<tr> <td> 网站名称: </td> <td> <input   type= "text "   name= "text1 "> </td> </tr>
<tr> <td> 网站地址: </td> <td> <input   type= "text "   name= "text2 "> </td> </tr>
<tr> <td> 网站名称: </td> <td> <input   type= "text "   name= "text3 "> </td> </tr>
<%}resource.closeStmt();%>
<tr>
        <td   align= "center "> <input   name= " "   type= "submit "   value= "提交 "   /> </td>
        <td   align= "center "> <input   name= " "   type= "reset "   value= "重置 "   /> </td>
    </tr>
    </table>
    <%
    String   text1Value   =   request.getParameter( "text1 ");
    String   text2Value   =   request.getParameter( "text2 ");
    String   text3Value   =   request.getParameter( "text3 ");  
    String   text4Value   =   request.getParameter( "text4 ");  
    if(text1Value   ==   null   && &nbs