Oracle jdbc driver

I am getting the following error:

ClassNotFoundException: oracle.jdbc.driver.OracleDriver

This is my snipit of code:

Class.forName("oracle.jdbc.driver.OracleDriver");

conn = DriverManager.getConnection(

"jdbc:oracle:thin:@pub:1521:pub",

"name",

"password");

Where do I get this driver? Once I have it, where do I put it? In the same directory as the rest of the jsp pages?

[427 byte] By [abacaxia] at [2007-11-26 20:57:31]
# 1
if you oracle db installed on you machine you can get the oracle jdbc driver on the jdbc/lib directory, drivers found can be ojdbc14.jar or classes12.jar. Once you have it, put it on the WEB-INF/lib directory of your application. restart application so the changes may take effect
jgalacambraa at 2007-7-10 2:26:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

f you oracle db installed on you machine you can get the oracle jdbc driver on the jdbc/lib directory, drivers found can be ojdbc14.jar or classes12.jar. Once you have it, put it on the WEB-INF/lib directory of your application. restart application so the changes may take effect

If you put it in the common/lib Tomcat container, do you also have to set your classpath or just shutdown and restart?

florida41a at 2007-7-10 2:26:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
your whole tomcat be restarted.. and the lib you put there will be shared to all your applications
jgalacambraa at 2007-7-10 2:26:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

I added the ojdbc14.jar and ora9i_2_0_1.jar files to my WEB-INF\lib directory and restarted the application. I now get this error:

C:\Program Files\New Atlanta\ServletExec ISAPI\ServletExec Data\default\GRT\pagecompile\_grt_fire_edit_xjsp.java:18: package oracle does not exist

import oracle.*;

^

1 error

*****

Is it the way I am importing?...

<%@ page import="java.sql.*" %>

<%@ page import="oracle.*" %>

Are the 2 mentioned packages sufficient for what I am trying to do?

See my original post if necessary.

Thank you!!!

abacaxia at 2007-7-10 2:26:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Latest results:

I took away the: <%@page import="oracle.*"%> line.

I am now getting this in my browser:

SQLException: Io exception: The Network Adapter could not establish the connection

By the way...this is a fully functional web server. we have another Java application connecting to the same DB just fine.

abacaxia at 2007-7-10 2:26:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Just checking back...The Oracle client does not need to be installed, does it?Any ideas?Thank you for any ideas!
abacaxia at 2007-7-10 2:26:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
<%@ import="oracle.jdbc.driver.OracleDriver"%>No you don't have to install an oracle client. DB might be shutdown and its listener is up
jgalacambraa at 2007-7-10 2:26:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
Try to TNSPING the oracle server from your location.Also take a look at this thread: http://forum.java.sun.com/thread.jspa?threadID=284032&start=0 it has some good troubleshooting suggestions.Message was edited by: appy77
appy77a at 2007-7-10 2:26:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...