%@ page import="java.sql.*" %>
<%
String connStr=request.getParameter("connStr");
if (connStr==null) {
connStr=(String)session.getValue("connStr");
} else {
session.putValue("connStr",connStr);
}
if (connStr==null) { %>
<% try { String sql_string = " select ENAME from EMP,DEPT " + " where DEPT.DNAME = 'RESEARCH' " + " and DEPT.DEPTNO = EMP.DEPTNO"; // Make the Connection dbbean.connect(); // Execute the SQL and get a HTML table out.println(dbbean.getResultAsHTMLTable(sql_string)); // Close the Bean to close the connection dbbean.close(); } catch (SQLException e) { out.println("
" + "There was an error doing the query:"); out.println ("
" + e + "\n
"); } %>