Dear friends,
After installing and configuring the
Tomcat 4 I am able to run
JSP and Servlats. But I am unable to connect to Oracle database (oracle 8i) using thin driver.
Sample code is :
<html>
<head><title>
Test JSP-JDBC</title></head><body>
<%@ page language="java"%>
<%@ page import="java.sql.*"%>
<%@ page import="oracle.jdbc.driver.OracleDriver" %>
<%
try
{
DriverManager.registerDriver(new OracleDriver());
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@myserver:1521:orcl","scott","tiger");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from emp");
while(rs.next())
{
out.println(rs.getString("ename")+"<br>");
}
}
catch (Exception e)
{
out.println(e);
}
%>
</body></html>
and the error msg is:
type: Exception report
message: Internal Server Error
description: The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception :
org.apache.jasper.JasperException: Unable to compile class for JSP
C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\second$jsp.java:4: Class oracle.jdbc.driver.OracleDriver not found in import.
import oracle.jdbc.driver.OracleDriver;
^
1 error
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
Please help me in solving this.
thanks in advance
Geethanadh
[Turned off smileys for so the
JDBC connection
string is displayed properly]
[ August 12, 2002: Message edited by: Bodie Minster ]