JDBC Information to connect CCI Oracle Server

  1. Driver name: "oracle.jdbc.driver.OracleDriver"
  2. Connection URL: "jdbc:oracle:thin:@cci-ora02.1521:class"
  3. When connecting via JDBC, do not append "@class" to your username.
  4. If you're using a non-centrally-managed PC, either on or off campus, then you'll most likely need to download the jar files, store them locally on your machine, then adjust your CLASSPATH according to where you've saved the jar files.

For students, you may follow the following steps to setup, compile, and load your servlet files to the servlet server.

  • First, you need to have some client software to login to the server. For example, you may use putty

The server name is coit-servlet02.uncc.edu. You can connect to the server using your NinerNet username and password.

After you login change directories,cd public_html/WEB-INFyou will find:

classes directory which should contain all your class files (and java files). Some servlet examples mayhave beenalready created there.

  • Second, you need some software (e.g., WinSCP or psftp, you can download from: to transfer files back and forth between your local machine and uncc servlet machine. The host name is still coit-servlet02.uncc.edu
  • download the following two jar files from the class webpage to your local directory, create a file folder named “lib”, move the two jar files to “lib” folder, then move the folder to public_html/WEB-INF (of host server coit-servlet02.uncc.edu) using WinSCP.

JDBC driverservlet-api.jar

  • After you login to the server using putty, you need to specify your classpath by typing this command:

export CLASSPATH=$CLASSPATH:~/public_html/WEB-INF/lib/ojdbc14.jar

  • Example to connect to Oracle:

Download SampleJDBC.java from our class webpage and move to your public_html/WEB-INF/classes, compile to see whether JDBC works.

  • Servlet examples:

Example 1: Download HelloWorld.javafrom our class webpage and move to your public_html/WEB-INF/classes, then compile.

Note: you need to set access right to all servlet class files, e.g.

chmod 755 HelloWorld.class

Edit the web.xml file under your public_html/WEB-INF by adding the following lines:

servlet

servlet-name>HelloWorld</servlet-name>

servlet-class>HelloWorld</servlet-class>

</servlet

servlet-mapping

servlet-name>HelloWorld</servlet-name>

url-pattern>/HelloWorld</url-pattern>

</servlet-mapping>

Then you can use to see whether it works.

Example 2: Download DBServlet.htmlfrom our webpage and move to the servlet server under the public_html directory.

Download DBServlet.java and move to your public_html/WEB-INF/classes on host machine.

 For DBServlet.java, please change Oracle account login in information using your own account. You may also want to change queries if you want.

 For DBServlet.html, change the link of ACTION as your new servlet such as

Compile DBServlet.java and set access rights to the following file.

chmod 755 DBServlet.class

Edit the web.xml file under your public_html/WEB-INF by adding the following lines:

servlet

servlet-name>DBServlet </servlet-name>

servlet-class>DBServlet </servlet-class>

</servlet

servlet-mapping

servlet-name>DBServlet</servlet-name>

url-pattern>/DBServlet</url-pattern>

</servlet-mapping>

Setup your database by running the SQL statements provided to you in the “sailor” handout in class.

For more information on how to access the Oracle database web interface visit the following page:

Test the setup

You can see a working example at:

login>/DBServlet.html

Please note you need to follow the above steps strictly. Contact me if you have any question.