The course staff is no longer supporting the JDBC version of the project. You may use these instructions, but do not expect support from the course staff.
The Oracle database on the undergraduate servers runs on a protected department host. This means that you will have to take a few additional steps before you can run your code.
To give you a basic idea on how to make database calls and iterate through resultsets, we have created a sample project. This sample project is not meant as a small scale representation of the term project. You should carefully read all the project documentation provided to understand what your term project requires.
A sample project can be found here. Clone this repository into your IDE of choice to take a look at how you can use Java to send SQL commands to a database.
If you have trouble to clone the project by using the HTTP link, try to use the SSH link or download the zip file
This is not mandatory but we do recommend setting up an SSH key to help reduce the need for constantly entering in your password when SSH-ing into the department's servers.
We do not endorse any IDE. The best IDE is the one you feel the most comfortable with. If you feel more comfortable with VS Code, then that is a fine choice. In the rest of this document, we mention Eclipse and IntelliJ but these are, by no means, the only choices available to you. Do note that due to the variety of IDEs available, we cannot provide support on how to use your particular IDE. Our instructions will provide support for IntellliJ as other courses in the department use IntelliJ.
For those of you who choose to use IntelliJ, there is a Database Tool available in the IntelliJ Ultimate Edition (you can get a yearlong free trial by signing up with your student email here). This tool allows you to access the Oracle database directly without SSH-ing into an undergrad server and running SQL*Plus. You can access this tool by going to View -> Tool Windows -> Database, clicking + ..., and then adding an Oracle Data Source. Enter your CWL undername and password in the SSH tab, and your Oracle account username and password (ora_CWLusername and a<student number>) in the General tab. Now, you can execute queries in IntelliJ, and the queries will be processed by your Oracle database. Once again, this tool is not mandatory and you do not have to use this version of IntelliJ (nor do you have to use IntelliJ at all) if you do not want to.
If you choose to use IntelliJ Ultimate, follow the setup instructions below to run the sample project
If you choose to use VSCode or Eclipse, follow the setup instructions below before running the sample project
The following steps assume that you have already imported the sample project into an IDE of your choice. We are not endorsing any IDE.
If you still continue to have problems, check that you haven't installed a personal version of Oracle which can cause problems with these instructions.
In the sample project,the Oracle JDBC driver has already been added to
the build path. When you start implementing your project, be sure to
include the Oracle driver in your build path! You can find a copy of the
driver from the department's servers at
/usr/lib/oracle/12.2/client64/lib/ojdbc8.jar.