<!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" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>

</head>
<body>
<% 
   out.print("start");
   DataSource ds = null;
   try{
	   InitialContext ctx=new InitialContext();
	   ds=(DataSource)ctx.lookup("java:comp/env/jdbc/mysql");
	   Connection conn = ds.getConnection();
	   String strSql = " select * from users";
	   ResultSet rs = conn.createStatement().executeQuery(strSql);
	   while(rs.next()){
	      out.print(rs.getString(1));                 
	   }
	   out.print("end");
   }
   catch(Exception ex){
       out.print("exeception :"+ex.getMessage());
       ex.printStackTrace();
   }
%>
</body>
</html>
