In this assignment, you will interact with a database through queries using Java Database Connectivity (JDBC) to perform SQL Queries. You can use a sample java program (QueryUI.java) to learn how to establish a connection to the database, query the database, and display the results/errors of the query.
You can learn more about how to interact with a database through JDBC in the JDBC trail of the Java tutorial.
You should read the Readme.txt
provided with the OracleTM
software for issues specific to JDBC connectivity with Oracle. This can
be
found at the path $ORACLE_HOME/jdbc/Readme.txt after you log into
bulldog
server. You need to set up the environment in order to compile and run
JDBC
programs for Oracle. Add $ORACLE_HOME/jdbc/lib/classes12.zip to your
CLASSPATH
and add $ORACLE_HOME/jdbc/lib to your LD_LIBRARY_PATH. This can be done
as
follows for C shell:
set CLASSPATH=($ORACLE_HOME/jdbc/lib/classes12.zip:. $CLASSPATH)You can add these lines to your initialization script.
set LD_LIBRARY_PATH=($LD_LIBRARY_PATH $ORACLE_HOME/jdbc/lib)
To view the GUI (after running the QueryInterface class) you need
to
be connected to the bulldog server via an X-Client. You can find a
X-Client
software installed on the machines in MWAH 177 lab. Connect using the
X-Client
software to bulldog server by providing your login and password and
then
execute the java program as follows:
java QueryUI
The Personal Address Book Query UI program provides a framework to perform some interesting queries on the Personal Address Book database we used in the first assignment. The query interface program provides the framework for your program to interface with the Personal Address Book database. It contains the skeleton to implement different queries on the database. You have to use this skeleton to execute and show results of 5 queries. These queries are as follows:
The Personal Address Book Query UI program is a menu driven application for querying the Personal Address Book database. There are two menus: Query and Connection. The Query Menu contains links to the various queries provided by the interface, and the connection menu provides functionality to connect to and disconnect from a database.
The panels to query the database do not appear unless you connect to the database. After you connect to the database, you can perform various queries on the database by clicking the queries in the Query menu and executing them.
The Personal Address Book Query UI program provides the skeleton
code for the GUI and
handling various error condtions (but not all). You have to modify the
code
to add the database interaction to the application using JDBC.
DETAILS TO BE ADDED.
Turn in a hard copy of your code.
You will also need to submit an electronic copy of your code (both source and compiled code so we can test). To do so you should put your code in a subdirectory prog02 under a subdirectory corresponding to your login. For example, if your login is rmaclin, you code should be in a directory rmaclin/prog02. The java source files in this directory should end in .java. To submit your code you should tar the file as follows: