Running Java with JDBC on the commandline on the moons/trucks systems:

  1. Download and put the mysql-connector-java in the directory of your choice (on the moons/trucks) systems
  2. Unpack the file with: tar -xzvf mysql-connector-java-5.1.15.tar.gz
  3. Add the JDBC driver (the .jar file) to your CLASSPATH:
    export set CLASSPATH=/nfs/faculty/tapia/j/mysql-connector-java-5.1.15/mysql-connector-java-5.1.15-bin.jar:$CLASSPATH
    (**NOTE change this to your path**)
  4. compile the demo code: javac
  5. run the demo code: java JDBCDemo

Running Java with JDBC from Eclipse to the database on the moons/trucks systems:

The database server is not open to the outside world. Just follow the instructions here to set up VPN. Then the TA code will work just as provided.