File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes tomcat can not load oracle??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat can not load oracle???" Watch "tomcat can not load oracle???" New topic
Author

tomcat can not load oracle???

Mary Wallace
Ranch Hand

Joined: Aug 25, 2003
Posts: 138
I'm trying to connect tomcat with oracle 8.
I pasted the renamed class.zip to class12.jar in common/lib
but im getting this error
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
what im doing wrong here?
im trying to connect frm my local machine in tomcat running to oracle
%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%
//Connection to database
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String qry = "";
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection( "jdbc racle:thin:@localhost/noradat:1521:nort ", "noradm", "pmadm1");
}catch(Exception e){
System.out.println("DB Connection Error: " + e);
System.out.println( e.getMessage());

}

String [] sections = {"","","","","","","","",""};
int i = 0;
try{
qry = "Select SECTION_TEXT from TEXT_CONTENT where SECTION_TYPE = 1";
stmt=con.createStatement();
rs=stmt.executeQuery(qry);

while(rs.next()){
sections[i] = rs.getString(1);
if(sections[i].equals("")){
sections[i] = "No information at this time. This section is under construction.";
}
i++;
}
rs.close();
stmt.close();
}catch(Exception e){

}
%>

some body.......help me
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

Where are you putting the jar file containing the oracle drivers?
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mary Wallace
Ranch Hand

Joined: Aug 25, 2003
Posts: 138
common/lib
machine is windows xp.
[ October 28, 2003: Message edited by: Mary Wallace ]
Mary Wallace
Ranch Hand

Joined: Aug 25, 2003
Posts: 138
do i have change any xml files
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

I'd try putting into shared/lib. I don't remember off the top of my head what the nuances are between common and shared, but I've run into problems puttings stuff in the wrong one before.
Something to try. If it doesn't change the behavior, something other than the classpath may be afoot.
Btw, if you use the UBB code tags around your code, it'll be easier for all to read.
bear
Dave Jochim
Ranch Hand

Joined: Jan 08, 2003
Posts: 31
Instead of just renaming classes12.zip to classes12.jar, I unzipped it first and then re-jarred it. I don't know if this could be the problem or not.
Mary Wallace
Ranch Hand

Joined: Aug 25, 2003
Posts: 138
i changed thin to oci.after that was able to make connection.
thanks all.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat can not load oracle???
 
Similar Threads
Servlet connection with Jdbc
Locate my data base?
jsp page not show oracle data
HashMap and the While Loop Story
JSP/Servlet VS PHP