<%@ page language= "java" import= "java.util.*" pageencoding= "Utf-8"%>
<%@ page import= "java.sql.*"%>
<%@ page import= "com.mysql.jdbc.*"%>
<jsp:usebean id= "myjdbc01" scope= "page" class= "Com.zss.www.DBConn"/>
<%
Request.setcharacterencoding ("Utf-8");
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<base href= "<%=basePath%>" >
<title>my JSP ' 001.jsp ' starting page</title>
<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This is my page" >
<!--
<link rel= "stylesheet" type= "Text/css" href= "Styles.css" >
-
<body>
<%
Out.println ("<table width= ' border= ' 1 ' >");
Out.println ("<tr>");
Out.println ("<th scope= ' col ' > Study No. </th>");
Out.println ("<th scope= ' col ' > class </th>");
Out.println ("</tr>");
String sql= "SELECT * from Information";
ResultSet rs = myjdbc01.doselect (SQL);
while (Rs.next ()) {
Out.println ("<tr>");
Out.println ("<td>");
Out.println (rs.getstring (1));
Out.println ("</td>");
Out.println ("<td>");
Out.println (rs.getstring (2));
Out.println ("</td>");
Out.println ("</tr>");
}
Out.println ("</table>");
%>
</body>
Job Job JSP