随笔 - 64  文章 - 9  trackbacks - 0
<2024年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(6)

我参与的团队

随笔分类(88)

随笔档案(92)

文章分类(142)

文章档案(182)

天基成员

学习园

我的海角

搜索

  •  

积分与排名

  • 积分 - 180563
  • 排名 - 318

最新评论

<%@ page contentType="text/html;charset=gbk" import="java.sql.*"%>
<html>
<body>
<font size="20">
<%
Connection con =null;
Statement stmt =null;
ResultSet rs = null;
String sql = "";
try{
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 con = DriverManager.getConnection("jdbc:odbc:st","","");
 stmt = con.createStatement();
 sql = "select * from stud";
 rs = stmt.executeQuery(sql);
out.print("姓名"+" "+"年龄"+" "+"性别"+" "+"地址<br>");
 while(rs.next()){
   out.print(rs.getString("username")+" "+rs.getInt("age")+" "+rs.getString("sex")+" "+rs.getString("address")+"<br>");
   }
con.close();
}catch(Exception e){e.printStackTrace();}
%>
</font>
</body>
</html>
<%@ page contentType="text/html;charset=gbk" import="java.sql.*"%>
<html>
<body>
<font size="20">
<%
Connection con =null;
Statement stmt =null;
ResultSet rs = null;
String sql = "";
try{
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 con = DriverManager.getConnection("jdbc:odbc:st","","");
 stmt = con.createStatement();
 sql = "select * from stud";
 rs = stmt.executeQuery(sql);
out.print("姓名"+" "+"年龄"+" "+"性别"+" "+"地址<br>");
 while(rs.next()){
   out.print(rs.getString("username")+" "+rs.getInt("age")+" "+rs.getString("sex")+" "+rs.getString("address")+"<br>");
   }
con.close();
}catch(Exception e){e.printStackTrace();}
%>
</font>
</body>
</html>
<%@ page contentType="text/html;charset=gbk" import="java.sql.*"%>
<html>
<body>
<font size="20">
<%
Connection con =null;
Statement stmt =null;
ResultSet rs = null;
String sql = "";
try{
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 con = DriverManager.getConnection("jdbc:odbc:st","","");
 stmt = con.createStatement();
 sql = "select * from stud";
 rs = stmt.executeQuery(sql);
out.print("姓名"+" "+"年龄"+" "+"性别"+" "+"地址<br>");
 while(rs.next()){
   out.print(rs.getString("username")+" "+rs.getInt("age")+" "+rs.getString("sex")+" "+rs.getString("address")+"<br>");
   }
con.close();
}catch(Exception e){e.printStackTrace();}
%>
</font>
</body>
</html>
posted on 2009-03-30 11:55 鹏凌 阅读(127) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: