Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsp and Oracle class12.zip  RSS feed

 
Kimberly Garcia
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been going around and 'round the internet and have been in this forum a hundred times, I've tried almost all the suggestions but it's just not working.. I'm fairly new to jsp,java and oracle..I've tried the connectionBean with java and mysql and it worked fine but now that i wanna connect to Oracle, it cannot find driver..

here's what i've done:
1. I put classes12.zip @ $TOMCAT_HOME$\lib
2. set classpath to ...\lib\classes12.zip
I've also tried:
1. rename classes12.zip to .jar by simply changing the zip to jar
2. then set class path to ..\lib\classes12.jar
P.S
the server is on another computer, I'm working within the network and the ORACLE is located in a different computer, one I cannot configure because of restrictions.

I know the code works fine coz it works fine with mysql i simple changed the codes that needed to be changed..

Please I really need your help, it's starting to frustrate me. Could you please give me a step by step on how to configure everything from classpath to whatever I need to do to run this code..please please.. and thanks in advance sorry if this post is too long..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kimberly, welcome to the Ranch.

A couple of things:

Kimberly Garcia wrote:but it's just not working..

What's not working? Just saying "it doesn't work" isn't helpful. Please read this for more information.

I know the code works fine coz ...

"coz" is not a real word. Please use only real words when posting to the forums. Please read this for more information.

Please explain what the exact problem is and I'm sure you'll get the help you need.
 
Kimberly Garcia
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry if that was unclear...let me shed more light on this..

There are 3 computers. computerA is where the oracle server is, computerB is where the tomcat server, and computerC is trying to access these two computers remotely (via network). I can run my jsp and javabeans just fine through computerC, but when I try connecting to Oracle using the driver, it gives the error: java.lang.ClassNotFoundExceptionracle.jdbc.driver.Oracle.

I understand that this is because it cannot locate driver. Here's what I've done so far:
1. put classes12.zip to $TOMCAT_HOME/lib
2. set classpath to C:/Program Files/Apache Software Foundation/Tomcat 6.0/lib/classes12.zip
still, when I run the code, i still get the ClassNotFoundException.
then i tried:
1. rename classes12.zip to classes12.jar (right-click rename)... is there another way of renaming it? Because I might be doing it wrong
2. then set classpath to C:/Program Files/Apache Software Foundation/Tomcat 6.0/lib/classes12.jar
still, i get the ClassNotFoundException
and now, classes12.jar is corrupted and I cannot delete it it says: the file might be in use

I cannot set classpath of ORACLE_HOME since I am not authorized to configure computerA where the Oracle database is.

I really don't know what else to do. Please help me. I'm sorry if this is still unclear. I'm really new to jsp,java and oracle...I can understand the codes and syntax but I have no idea how else to configure this.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume that you are either seeing this error message in the Tomcat logs, or in a stack trace sent to the browser?

The system where Tomcat is running the JDBC code is all that matters. You don't need to do anything to the systems where the DB is running, or where the browser is running.

On the Tomcat server, all you should need to do is to drop the jar/zip file contaiing the driver class into Tomcat's lib folder (I assume this is Tomcat 6?).

The classpath settings are all completely moot. Classpaths are used only while compiling and not at run time. (Tomcat constructs its own classpaths from its lib folder and the WEB-INFs of the web contexts).
 
Kimberly Garcia
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:I assume that you are either seeing this error message in the Tomcat logs, or in a stack trace sent to the browser?


I have this code:
<% try{
Class.forName("oracle.jdbc.driver.Oracle");
%>
<% out.print("Successful");%>
<%}
catch(Exception e){
%>
<% out.print(e);
}
%>

Of course this isn't the entire code, but just to give you an idea of how I got the error message.

Bear Bibeault wrote:
On the Tomcat server, all you should need to do is to drop the jar/zip file contaiing the driver class into Tomcat's lib folder (I assume this is Tomcat 6?).

The classpath settings are all completely moot. Classpaths are used only while compiling and not at run time. (Tomcat constructs its own classpaths from its lib folder and the WEB-INFs of the web contexts).


I've done that already- placed the classes12.zip and classes12.jar inside the Tomcat's lib folder but still I get the error message ClassNotFoundError. How can I properly rename classes12.zip to jar? I might be doing it wrong. and about the classpath, I've tried not setting the classpath when I was trying to connect to mysql and I got ClassNotFoundError, but when I finished setting up classpath it worked.

I really have no idea what's wrong.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're doing this in a JSP?

In any case, if the zip file is not corrupt and contains the driver class, all you need to do is to put it in the lib folder. That's it. If that's not working, something else is at play.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!