Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat can not load oracle???

 
Mary Wallace
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65228
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are you putting the jar file containing the oracle drivers?
bear
 
Mary Wallace
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
common/lib
machine is windows xp.
[ October 28, 2003: Message edited by: Mary Wallace ]
 
Mary Wallace
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do i have change any xml files
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65228
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i changed thin to oci.after that was able to make connection.
thanks all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic