import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class Display8900 extends HttpServlet { public static Connection conn; public static Statement stmt; public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request,response); } public void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); try { Class.forName("oracle.jdbc.driver.OracleDriver"); } catch(ClassNotFoundException e){ out.println("Error loading the Driver:"+e.getMessage()); return; } Connection conn = null; try { conn = DriverManager.getConnection ( Utilities8900.CONNECTSTRING,Utilities8900.ID,Utilities8900.PASSWORD); } catch (SQLException e1) { out.println("Error connecting to Oracle:"+e1.getMessage()); return; } if (conn == null) { out.println("Null Connection"); return; } Statement stmt = null; try { stmt = conn.createStatement (); } catch (SQLException e) { out.println("createStatement " + e.getMessage()); try {conn.close();} catch (SQLException e2) {}; return; } ResultSet rset = null; out.println(Utilities8900.PageHeader(Utilities8900.HEADER)); String when[] = new String[50]; String who[] = new String[50]; int count = 0; String query = "select name from faculty where name not in " + " (select who from schedule where who is not null) order by name"; try { rset = stmt.executeQuery(query); } catch (SQLException e) { out.println("executeQuery " + e.getMessage()); return; } String remainingFaculty[] = new String[50]; count = 0; try { if (rset.next()) { do { remainingFaculty[count++] = rset.getString(1); } while (rset.next()); } } catch (SQLException e) { out.println("executeQuery " + e.getMessage()); return; } query = "select to_char(when,'DD-MON-YYYY'),who " + "from schedule order by when"; try { rset = stmt.executeQuery(query); } catch (SQLException e) { out.println("executeQuery " + e.getMessage()); return; } int sCount = 0; try { if (rset.next()) { do { when[sCount] = rset.getString(1); who[sCount++] = rset.getString(2); } while (rset.next()); } } catch (SQLException e) { out.println("executeQuery " + e.getMessage()); return; } // Print the Page out.println("