*.jsp
<%@ page language="java" import=" com.qs.data.* " pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>rs_example</title>
</head>
<body>
<%
DbBase db1=new DbBase();//定义数据控制层对象
DbTable dt1=db1.executeQuery("select * from question");//获取一个虚拟表对象
out.println("<table>");
while( dt1.next() ){
out.println("<tr>");
out.println("<td>"+ dt1.getValue("ID") +"</td>");//根据字段名取值
out.println("<td>"+ dt1.getValue(1) +"</td>");//根据字段索引取值
out.println("<td>"+ dt1.getValue(2) +"</td>");
out.println("</tr>");
}
out.println("</table>");
%>
</body>
</html>