// To compile and run this program on an MCS Department Linux machine: // javac ListParties.java // env LD_LIBRARY_PATH=/Net/gac/home/m/a/max/instantclient_11_1 \ // CLASSPATH=/Net/gac/home/m/a/max/instantclient_11_1/ojdbc5.jar:. \ // java ListParties import java.sql.*; public class ListParties{ public static void main(String[] args){ try{ Class.forName("oracle.jdbc.OracleDriver"); // connect to our server with username "anon" and password "anon": Connection myCon = DriverManager.getConnection ("jdbc:oracle:oci:@//thebe.gac.edu:1521/xe", "anon", "anon"); // You need to put here the code to retrieve the parties' names // and print them out, using the JDBC Connection myCon, as // shown in our textbook. I suggest you start with a simple // version that just retrieves each party's full name and // prints it on a line. Then once that works, you can make // a fancier version that is analogous to the PL/SQL procedure // I provided as an example, in which each party ID number is // shown on a line with a comma-separated list of names. } catch(Exception e){ System.err.println(e); System.exit(1); } } }