You may do this project either on Omega or on a PC.
You may code your application program on Omega using either Java or C:
export set CLASSPATH=.:~/mysql-connector-java.jar:$CLASSPATH(you may put this line at the end of your .login file so that you don't have to execute it every time). Then download mysql.java and change it to work on your database (change: user, password, db, and the query). You should also use omega.uta.edu instead of localhost in the jdbc string. You compile it using javac mysql.java and you run it using java SQL. You should make sure that it works before you start coding your program.
gcc -I/usr/include/mysql -L/usr/lib64/mysql -lmysqlclient -lz mysql.cThen, to execute it, you do ./a.out.
ssh2 -L 3306:localhost:3306 firstname.lastname@example.org(replace xyz9999 with your own net-ID). Give your net-ID password and keep the window open and connected to omega. If you get the message "Warning: Local TCP/IP forwarding for port 3306 port failed." you need to disable your PC firewall (eg, if you use Symantec, set Network Threat Protection to off).
You compile the mysql.java using javac mysql.java. Every time you want to execute your java program, you need to do the following:
java -classpath "C:\Documents and Settings\Owner\Desktop\mysql-connector-java.jar";"." SQLor wherever you stored the mysql-connector-java.jar file. If you get a Java error: "Exception in thread 'main' com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure", it means that your ssh2 connection has failed: login again using ssh2.
For Linux or Mac users: you can do the project on your computer, but you need to use ssh instead of ssh2 and : instead of ; in the classpath.
CheapBooks is interested in an application program interface that is easy to use by customers. Although you will not build a web-based interface, you are expected to write a menu-based main program that consists of the following application functions for their daily transactions and is open for the inclusion of future programs.
The application program should use an ASCII interface (ie. by reading input text from the terminal and printing out text to the terminal), but it must be menu-based (eg. it may provide choices by number and ask the user to choose a number). For example, it may say: "type 1 to start a customer session, type 2 to search ...", and then may ask other info, such as customer name, etc.
You must handin your code as follows. All your source code must be in one file (eg, code.java or code.c). Don't submit any other file except your source code file. You must use the following form to submit your file electronically. You may submit it as many times as you like, but only the most recently submitted file will be retained and evaluated.
Last modified: 10/27/10 by Leonidas Fegaras