import java.sql.*; public class ListParties{ public static void main(String[] args){ try{ // The newInstance() call is a work around for some // broken Java implementations Class.forName("com.mysql.jdbc.Driver").newInstance(); // connect to our server with username "sosviewer" and password "notsecret": Connection myCon = DriverManager.getConnection ("jdbc:mysql://thebe.virtual.gac.edu/sos", "sosviewer", "notsecret"); // // You need to put here the code to retrieve the information // and print it out, using the JDBC Connection myCon, as // shown in our textbook. // // I suggest you start with printing one line per candidate // for a U.S. office, showing the office title and party // abbreviation retrieved from the sos.candidates table. // // Then once that works, you can make a fancier version in which // each office is shown on a line with a comma-separated list // of party abbreviations. // } catch(Exception e){ System.err.println(e); System.exit(1); } } }