ClassNotFoundException: oracle.jdbc.driver.OracleDriver
- From: kajko <kajko04@xxxxxxxxxxxxxx>
- Date: Thu, 14 Apr 2005 17:07:14 -0400
Hi.
I try play a little bit with a oracle, tomcat, apache. I setup apache,
tomcat, and the oracle 10g. Now I try login to my database by website using
jsp files.
Base on website : http://elab.bus.umich.edu/how-to-oracle-jsp.php
I made the page to pull up some records - just to see if this works.
When I point in the webbrowser to this file i receive error:
ClassNotFoundException: oracle.jdbc.driver.OracleDriver
When I am login on that server I can use sqlplus.
What could be problem?
I use a debian system with oracle10g, tomcat 5.5.9 and jdk1.5.
Please point me to some useful documents, examples.
Thanks for help.
Mariusz
Here is a code what I used:
<%@ page import="java.sql.*" %>
<HTML>
<HEAD><TITLE>Simple Oracle Example</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<B>Employees</B>
<BR><BR>
<%
Connection conn = null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(
"jdbc:oracle:thin:@192.168.1.20:1521:orcl",
"orauser",
"2005or");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM NMS_DATA");
//Print start of table and column headers
out.println("<TABLE CELLSPACING=\"0\" CELLPADDING=\"3\"
BORDER=\"1\">");
out.println("<TR><TH>ID</TH><TH>NAME</TH></TR>");
//Loop through results of query.
while(rs.next())
{
out.println("<TR>");
out.println("<TD>" + rs.getString("EmpID") + "</TD>");
out.println("<TD>" + rs.getString("Name") + "</TD>");
out.println("</TR>");
}
out.println("</TABLE>");
}
catch(SQLException e)
{
out.println("SQLException: " + e.getMessage() + "<BR>");
while((e = e.getNextException()) != null)
out.println(e.getMessage() + "<BR>");
}
catch(ClassNotFoundException e)
{
out.println("ClassNotFoundException: " + e.getMessage() + "<BR>");
}
finally
{
//Clean up resources, close the connection.
if(conn != null)
{
try
{
conn.close();
}
catch (Exception ignored) {}
}
}
%>
</CENTER>
</BODY>
</HTML>
.
- Follow-Ups:
- Re: ClassNotFoundException: oracle.jdbc.driver.OracleDriver
- From: Lee Fesperman
- Re: ClassNotFoundException: oracle.jdbc.driver.OracleDriver
- Prev by Date: Re: Oracle driver killing jvm
- Next by Date: Re: setNull for mysql
- Previous by thread: Oracle driver killing jvm
- Next by thread: Re: ClassNotFoundException: oracle.jdbc.driver.OracleDriver
- Index(es):
Relevant Pages
|
|