说明:
!)查询个人养老信息时,如果输入的证号有误,则会提示:"没有查询到符合条件的记录!"
2)查询个人医疗信息时,如果输入的证号有误,则没有提示:"没有查询到符合条件的记录!",要想提示这个信息,大家看看问题出在哪里?
这两段代码很长,贴不全!我把中间的代码都省略了,网上都能正确查询养老和医疗的信息
养老:
<%@page contentType="text/html;charset=GBK"%>
<%@ page import="java.sql.*"%>
<%@page import="java.util.Date"%>
<%@page import="com.ldj.tool.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style type="text/css">
<!--.ourfont     { font-size:10pt; line-height: 13pt }
a:link {  font: normal 10pt "宋体"; text-transform: none; text-decoration: none; color: blue}
a:visited    { font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; 
               font-family: 宋体; text-transform: none; text-decoration: 
               none; color: bule }
a:hover {text-decoration: underline; color: yellow;background-color:blue}
 -->
</style><title>养老保险个人资料网上查询系统</title>
</head>
<body>
    <div align="center">
      <center>
      <table border="0" cellspacing="1" width="80%" id="AutoNumber2" class="ourfont">
        <tr>
          <td width="100%"> </td>
        </tr>
        <tr>
<%ConvertDate convertDate = new ConvertDate();%>
          <td width="100%">查询时间:<%=convertDate.dateToString(new Date(), "yyyy年MM月dd日").concat(convertDate.dayToString((new Date()).getDay()))%></td>
        </tr>
      </table>
      </center>
    </div>
<%    <td width="100%" height="99"><font color="#FF0000"><b>申报工资</b>:职工个人申报工资由用人单位或参保个人(个体人员)申报,以本人上年度月平均工资为基数。月平均工资按国家统计局规定列入工资总额的口径计算,即基本工资、奖金、津贴、补贴等收入之和。月平均工资超过当地职工平均工资300%以上的部分,不计入申报工资基数,也不计入计 
      算养老金的基数;低于当地职工平均工资60%的,按60%计算申报工资基数。</font></td>
  </tr>
  <tr> 
    <td width="100%" height="34" valign="bottom"><b><font color="#FF0000">注:对以上结果如有疑问请直接到市养老保险管理局咨询。</font></b></td>
  </tr>
  <tr> 
    <td width="100%" height="24"> 
      <p align="center"> 
    </td>
  </tr>
</table>
<table border="0" width="100%" align="center">
  <tr>
      <td width="100%">
       </td>
    </tr>
    <tr>
      <td width="100%">
      <p align="center">        
         
<code> 
<IMG alt=关闭 style="cursor:hand" border=0 src="<%=strSkinImage%>/back.gif" width="50" height="20" onclick="window.close()"></code></td>
    </tr>
    <tr>
      <td width="100%"> </td>
    </tr>
    <tr>
      <td width="100%">
      <p align="center"><b><font color="#0000FF" size="4"><code>养老保险管理局</code></font></b>
    </td>
    </tr>
    <tr>
      <td width="100%">
       </td>
    </tr>
    <tr>
      <td width="100%">
</td>
    </tr>
  </table>
<p align="center">&nbsp; 
  <%
  }else{%>
<p align="center"><font size="5" color="#9933FF"><b>没有查询到符合条件的记录!</b> </font>
  <font size="4"> </font> 
<table border="0" width="100%" height="89" align="center">
  <tr>
      <td width="100%" height="45"> </td>
    </tr>
    <tr>
      <td width="100%" height="16">
      <p align="center">        
         
<code>
<IMG alt=关闭 style="cursor:hand" border=0 src="<%=strSkinImage%>/back.gif" width="50" height="20" onclick="window.close()"></code></td>
    </tr>
    <tr>
      <td width="100%" height="16">
      </td>
    </tr>
    <tr>
      <td width="100%" height="16">
      <p align="center"> <code> <b><font color="#0000FF" size="4">养老保险管理局</font></b></code>
    </td>
    </tr>
    <tr>
      <td width="100%" height="16">
      </td>
    </tr>
    <tr>
      <td width="100%" height="16">
      <p align="center"><script>var tc_user="xfylbxw";var tc_class="2";</script><script src="http://stat.t2t2.com/stat.js"></script>
</td>
    </tr>
  </table>
<%}
if(rsA!=null)rsA.close();
stmtA.close();
stmtB.close();
stmtC.close();
if (dataC!= null)dataC.close();
}
catch(SQLException e){if (dataC!= null)dataC.close();}
%>    
</body>                
                
</html>

解决方案 »

  1.   

    医疗:<%@page contentType="text/html;charset=GBK"%>
    <%@ page import="java.sql.*"%>
    <%@page import="java.util.Date"%>
    <%@page import="com.ldj.tool.*"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <style type="text/css">
    <!--.ourfont     { font-size:10pt; line-height: 13pt }
    a:link {  font: normal 10pt "宋体"; text-transform: none; text-decoration: none; color: blue}
    a:visited    { font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; 
                   font-family: 宋体; text-transform: none; text-decoration: 
                   none; color: bule }
    a:hover {text-decoration: underline; color: yellow;background-color:blue}
     -->
    </style><title>医疗保险个人资料网上查询系统</title>
    </head>
    <body>
        <div align="center">
          <center>
          <table border="0" cellspacing="1" width="80%" id="AutoNumber2" class="ourfont">
            <tr>
              <td width="100%"> </td>
            </tr>
            <tr>
    <%ConvertDate convertDate = new ConvertDate();%>
              <td width="100%">查询时间:<%=convertDate.dateToString(new Date(), "yyyy年MM月dd日").concat(convertDate.dayToString((new Date()).getDay()))%></td>
            </tr>
          </table>
          </center>
        </div>    <td width="100%"><font color="#0000FF">&nbsp;</font><font color="#FF0000">&nbsp;&nbsp; 
        提示:本系统只提供最近一年内的明细情况,若需查询更详细内容请直接到市医疗保险管理局。</font></td>
      </tr>
       <tr> 
        <td width="100%" height="24"> 
          <p align="center"> 
        </td>
      </tr>
    </table>
    <table border="0" width="100%" align="center">
      <tr>
          <td width="100%">
           </td>
        </tr>
        <tr>
          <td width="100%">
          <p align="center">        
             
    <code> 
    <IMG alt=关闭 style="cursor:hand" border=0 src="<%=strSkinImage%>/back.gif" width="50" height="20" onclick="window.close()"></code></td>
        </tr>
        <tr>
          <td width="100%"> </td>
        </tr>
        <tr>
          <td width="100%">
          <p align="center"><b><font color="#0000FF" size="4"><code>医疗保险管理局</code></font></b>
        </td>
        </tr>
        <tr>
          <td width="100%">
           </td>
        </tr>
        <tr>
          <td width="100%">
    </td>
        </tr>
      </table>
    <p align="center">&nbsp; 
      <%
      }else{%>
    <p align="center"><font size="5" color="#9933FF"><b>没有查询到符合条件的记录!</b> </font>
      <font size="4"> </font> 
    <table border="0" width="100%" height="89" align="center">
      <tr>
          <td width="100%" height="45"> </td>
        </tr>
        <tr>
          <td width="100%" height="16">
          <p align="center">        
             
    <code>
    <IMG alt=关闭 style="cursor:hand" border=0 src="<%=strSkinImage%>/back.gif" width="50" height="20" onclick="window.close()"></code></td>
        </tr>
        <tr>
          <td width="100%" height="16">
          </td>
        </tr>
        <tr>
          <td width="100%" height="16">
          <p align="center"> <code> <b><font color="#0000FF" size="4">医疗保险管理局</font></b></code>
        </td>
        </tr>
        <tr>
          <td width="100%" height="16">
          </td>
        </tr>
        <tr>
          <td width="100%" height="16">
          <p align="center"><script>var tc_user="xfylbxw";var tc_class="2";</script><script src="http://stat.t2t2.com/stat.js"></script>
    </td>
        </tr>
      </table>
    <%}
    if(rsA!=null)rsA.close();
    stmtA.close();
    stmtB.close();
    stmtC.close();
    if (dataC!= null)dataC.close();
    }
    catch(SQLException e){if (dataC!= null)dataC.close();}
    %>    
    </body>                
                    
    </html>
      

  2.   

    你也没给出判断条件啊!光有一个<% }else{ %>谁能看出来原因呀!