Welcome to the FMB
"); // Use the shared connection. Connection db = getDB(); // A statement is analogous to a command line. Statement stmt = db.createStatement(); // A result set provides a one-time pass over the result of some query. // This query determines how many names (not synonyms) are in the database. ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM names WHERE isSynonym = 0;"); // The cursor starts before the first record. // .next() returns false once the cursor falls off the end. rs.next(); out.println("There are " + rs.getString(1) + " terms in the FMA.
"); // Statements consume database resources, so they need to be closed. stmt.close(); } else { out.println("Unknown request type: " + reqType + "
"); } %>