<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.* " %>
<HTML>
<BODY>
 <% Connection con=null;
    Statement sql=null; 
    ResultSet rs=null;
    try{Class.forName("oracle.jdbc.driver.OracleDriver"); 
       }
    catch(ClassNotFoundException e){}
    try
      {  con=
DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.35:1521:Lea","scott","tiger");
         sql=con.createStatement();
         rs=sql.executeQuery("select * from emp");
         out.print("<Table Border>");
         out.print("<TR>");
            out.print("<TH width=100>"+"EMPNO");
            out.print("<TH width=50>"+"Ename");
         out.print("</TR>");
       while(rs.next())
       { out.print("<TR>");
             int n=rs.getInt(1); 
             out.print("<TD >"+n+"</TD>");
            String e=rs.getString(2); 
             out.print("<TD >"+e+"</TD>");
         out.print("</TR>") ;  
        }
        out.print("</Table>");
        con.close();
     }
   catch(SQLException e1) {out.print(""+e1);}
 %>
</BODY>
</HTML>

