Assignment #6: JDBC

This program must be done on your home computer; otherwise you will not be able to setup the odbc source.

Download the baseball database (Access version) and enable an odbc source. See the class lectures page for details on how to do this. Download Day25.java, and compile and run it. If you set your odbc source correctly, the program should run just as in class.

If you are running Java 1.5 or earlier, please look at Day25a.java which contains additional code to load the driver. If you are getting the error message similar to the one below, you probably need the code.

java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getConnection(DriverManager.java:545)
        at java.sql.DriverManager.getConnection(DriverManager.java:193)
        at Lookup.main(Lookup.java:35)

The assignment is to write a JDBC program to find all Major League baseball players that went to Florida International University.

You will need the Master, Schools, and SchoolsPlayers tables. In those tables you will need nameLast, nameFirst, schoolName, schoolID, and playerID columns. The playerIDi and schoolID colums both appear in two tables, and need to be joined in a large AND statement.

Remember that the syntax of a SELECT statement may require parentheses around each of the components of the AND statement, and that strings such as 'Florida International University' require single quotes.

Covers

java.sql classes.