%@ page import="java.sql.* , oracle.jsp.dbutil.*" %>
<%
String connStr=request.getParameter("connStr");
if (connStr==null) {
connStr=(String)session.getValue("connStr");
} else {
session.putValue("connStr",connStr);
}
if (connStr==null) { %>
<% try { // Make the Connection cbean.connect(); String sql = "SELECT ename, sal FROM scott.emp ORDER BY ename"; // get a Cursor Bean CursorBean cb = cbean.getCursorBean (CursorBean.PREP_STMT, sql); out.println(cb.getResultAsHTMLTable()); // Close the cursor bean cb.close(); // Close the Bean to close the connection cbean.close(); } catch (SQLException e) { out.println("
" + "There was an error doing the query:"); out.println ("
" + e + "\n
"); } %>