| 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 opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50693
|
|
Where are you putting the jar file containing the oracle drivers? bear
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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 opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50693
|
|
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.
|
 |
 |
|
|
subject: tomcat can not load oracle???
|
|
|