NetBeans/Tomcat JDBC Setup

thrillukrainianSoftware and s/w Development

Jun 7, 2012 (4 years and 5 months ago)


Information Systems 579 Fall 2003

NetBeans/Tomcat JDBC Setup
To use JDBC to connect to a relational database from within a Java program, we need to do a little bit of
configuration. We need to configure to allow two activities to occur: (1) NetBeans needs to be able to “see”
the set of Java classes necessary to compile a program that uses JDBC; and (2) Tomcat needs to be able to
find these same classes in order to establish a connection from web-based classes (JSPs and servlets).
Follow the steps below to configure JDBC for our development environment:
1. Download classes12.jar (URL below, or use the link on the development info page of the class web
site). Save this file to c:\java\jwsdp-1.2\jwsdp-shared\lib. If you have Tomcat running, stop and restart
it. Performing this step makes the Oracle .jar file visible to Tomcat.

2. Start up NetBeans. Right-click on the Filesystems line in the left-hand window, then select Mount->
Archive Files. Navigate to c:\java\jwsdp-1.2\jwsdp-shared\lib, click on classes12.jar, and click Finish.
Performing this step gives NetBeans access to all of the classes in the Oracle JDBC .jar file.
3. Remove the examples in c:\java\examples, and reinstall the examples using the URL below. The new
examples contain a series of JDBC examples in addition to the original Java examples.


4. Right-click the c:\java\examples folder in NetBeans, and select “Refresh
Folder”. You should see a subfolder called “jdbc_examples”. Within that
folder, you should see the java sources shown at right. The first three
files are utility programs that are used by the Employee* and Fruit*
examples, and they should already be compiled, so no need to do
anything with them.
5. The two “Creation” programs are used to populate data in various Oracle
tables. You do not need to run these, as there is data out there already.
Feel free to try the EmployeeTest* and FruitTest* programs to see them work in NetBeans.