<!doctype html public "-//w3c//dtd html 4.0 transitional//en" 
"http://www.w3.org/TR/REC-html40/strict.dtd">
<%@ page import="java.sql.*"%>
<%@ page import="javax.sql.*"%>
<%@ page import="javax.naming.*"%>
<%@ page session="false" %>
<%@ page contentType="text/html;charset=GB2312" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<% 
DataSource ds = null;
Connection conn=null;
Statement stmt=null;
try{
InitialContext ctx=new InitialContext();
ds=(DataSource)ctx.lookup("java:comp/env/MyDataSource");
conn = ds.getConnection();
stmt = conn.createStatement();
String strSql = " select * from user";
ResultSet rs = stmt.executeQuery(strSql);
while(rs.next()){
out.print("ÓÃ»§ÃûÎª¡£"+rs.getString(1)); 
}

        if(rs!=null){rs.close();}
        if(stmt!=null){stmt.close();}
        if(conn!=null){conn.close();} 
}
catch(Exception e){
e.printStackTrace();
}
%>
</head>
<body>
</body>
</html>
