<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<HTML>
<BODY  ><Font size=5>
  <% 
    String zichanxuhao=request.getParameter("zichanxuhao");
          if(zichanxuhao==null)
            {zichanxuhao="";
            }
     byte b[]=zichanxuhao.getBytes("ISO-8859-1");
     zichanxuhao=new String(b);
    
    String leixing=request.getParameter("leixing");
          if(leixing==null)
            {leixing="";
            }
     byte c[]=leixing.getBytes("ISO-8859-1");
     leixing=new String(c);
  
    String yongtu=request.getParameter("yongtu");
          if(yongtu==null)
            {yongtu="";
            }
     byte d[]=yongtu.getBytes("ISO-8859-1");
     yongtu=new String(d);
    
     String peizhi=request.getParameter("peizhi");
          if(peizhi==null)
            {peizhi="";
            }
     byte e[]=peizhi.getBytes("ISO-8859-1");
     peizhi=new String(e);



String jiage=request.getParameter("jiage");
          if(jiage==null)
            {jiage="";
            }
     byte w[]=jiage.getBytes("ISO-8859-1");
     jiage=new String(w);

String goumairiqi=request.getParameter("goumairiqi");
          if(goumairiqi==null)
            {goumairiqi="";
            }
     byte h[]=goumairiqi.getBytes("ISO-8859-1");
     goumairiqi=new String(h);

String shiyongzhouqi=request.getParameter("shiyongzhouqi");
          if(shiyongzhouqi==null)
            {shiyongzhouqi="";
            }
     byte j[]=shiyongzhouqi.getBytes("ISO-8859-1");
     shiyongzhouqi=new String(j);

String beizhu=request.getParameter("beizhu");
          if(beizhu==null)
            {beizhu="";
            }
     byte k[]=beizhu.getBytes("ISO-8859-1");
     beizhu=new String(k);

String zhuangtai=request.getParameter("zhuangtai");
          if(zhuangtai==null)
            {zhuangtai="";
            }
     byte l[]=zhuangtai.getBytes("ISO-8859-1");
     zhuangtai=new String(l);

String gudingzichan=request.getParameter("gudingzichan");
          if(gudingzichan==null)
            {gudingzichan="";
            }
     byte m[]=gudingzichan.getBytes("ISO-8859-1");
     gudingzichan=new String(m);

String fuwu=request.getParameter("fuwu");
          if(fuwu==null)
            {fuwu="";
            }
     byte n[]=fuwu.getBytes("ISO-8859-1");
    fuwu=new String(n);

     Connection con=null;
    Statement sql=null;
    ResultSet rs=null;
       try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); }
       catch(ClassNotFoundException event){}
   try {con=DriverManager.getConnection("jdbc:odbc:sun","sa","");
       sql=con.createStatement();
       String condition="INSERT INTO zichan VALUES"+"("+"'"+zichanxuhao+"','"
                                   +leixing+"','"
                                   +yongtu+"','"
+peizhi+"','"
+jiage+"','"

+goumairiqi+"','"
+shiyongzhouqi+"','"
+beizhu+"','"
+zhuangtai+"','"
+gudingzichan+"','"
+fuwu+"')";
       sql.executeUpdate(condition); 
       
     %>
     <P>添加新记录后的表：
     <%
       rs=sql.executeQuery("SELECT * FROM zichan ");
       out.print("<Table Border>");
           out.print("<TR>");
              out.print("<TH width=100>"+"资产序号");
              out.print("<TH width=100>"+"资产类型");
              out.print("<TH width=50>"+"用途");
              out.print("<TH width=50>"+"配置");
              out.print("<TH width=50>"+"价格");
              out.print("<TH width=50>"+"购买日期");
              out.print("<TH width=50>"+"使用周期");
              out.print("<TH width=50>"+"备注");
              out.print("<TH width=50>"+"状态");
              out.print("<TH width=50>"+"资产名称");
              out.print("<TH width=50>"+"服务");
              out.print("</TR>");
       while(rs.next())
           {    out.print("<TR>");
                    
                     out.print("<TD >"+rs.getString(1)+"</TD>"); 
                     out.print("<TD >"+rs.getString(2)+"</TD>");
                     out.print("<TD >"+rs.getString(3)+"</TD>"); 
                     out.print("<TD >"+rs.getString(4)+"</TD>");
                     out.print("<TD >"+rs.getString(5)+"</TD>");  
                     out.print("<TD >"+rs.getString(6)+"</TD>");   
                     out.print("<TD >"+rs.getString(7)+"</TD>");   
                     out.print("<TD >"+rs.getString(8)+"</TD>");   
                     out.print("<TD >"+rs.getString(9)+"</TD>");   
                     out.print("<TD >"+rs.getString(10)+"</TD>");
                     out.print("<TD >"+rs.getString(11)+"</TD>");       
                     out.print("</TR>") ;  
         }
       out.print("</Table>");
      con.close();
     }
    catch(SQLException event)
          {out.print(""+event);
          }
 %>
</FONT>
</BODY>
</HTML>
