CS3340:  Intro OOP and Design

Database Example Application Setup

 

Step 1: create new project or open existing one

 

Step 2: Add database code to your application (see class materials for an example)

  • your code must have the correct database connectivity information

 

Step 3: Make sure you add the appropriate Database Driver (make sure it is the right version for YOUR database)

 

Project right click Properties. Go to the tab where you see the libraries for your Project. Here you see it is under Java Build Path then the Libraries tab.
"Add External JARs".


FOR US WITH ORACLE that means you will Now find where you installed previously your Oracle Instant Client and look for the appropriate Oracle JDBC JAR file (for me I have a file called ojdbc6.jar)

 

This is what it looks like after you select it and add it to your Project's libraries




IF you see the following kind of error this means you have not setup the driver appropriately

Step 4: Compile and run

 

Here is output of a simple program as shown in this example

© Lynne Grewe