随笔 - 64  文章 - 9  trackbacks - 0
<2021年4月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

常用链接

留言簿(6)

我参与的团队

随笔分类(88)

随笔档案(92)

文章分类(142)

文章档案(182)

天基成员

学习园

我的海角

搜索

  •  

积分与排名

  • 积分 - 162623
  • 排名 - 337

最新评论

<%@ 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 鹏凌 阅读(93) 评论(0)  编辑  收藏

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


网站导航: