Same answer.
1. The file should have the same name as the class.
2. put the d:\orant\jdbc\classes102.zip in your CLASSPATH for both
compiling and running it.
Compile and run it.
Lastly, rtfm on the servlet engine you are using to see where to register
the classes102.zip in its CLASSPATH
Thor HW
----- Original Message -----
From: Moloy Biswas <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 18, 2000 4:13 AM
Subject: help required very urgently
> Hi all
>
> I need help very badly. Pl respond.
>
> When I am trying to compile my servlet its giving the following error
>
> Class oracle.jdbc.driver.OracleDriver not found.
>
> its pointing to the following line
>
> DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
> // registering the driver
>
> I am attaching my file with this mail, pl respond
>
> Moloy
>
>
>
----------------------------------------------------------------------------
----
> import java.io.*;
> import java.sql.*;
> import java.math.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
> public class mservlet1 extends HttpServlet
> {
> public void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException
> {
> Connection con = null;
> Statement stmt = null;
> ResultSet rs = null;
>
> res.setContentType("text/html");
> PrintWriter out = res.getWriter();
>
> try
> {
> file://Load and therefore register the driver
> //
Class.forName("oracle.jdbc.driver.OracleDriver");
> DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
>
> file://Get connection to the database
> con =
DriverManager.getConnection("jdbc:oracle:oci8:@ORCL","moloy","moloy");
>
> file://Create a statement object
> stmt = con.createStatement();
>
> file://Execute an SQL query, get a ResultSet
> rs = stmt.executeQuery("SELECT FNAME,LNAME FROM
CONTACT");
>
> file://Display the result set as a list
> out.println("<HTML><HEAD><TITLE>Moloy's
list...</TITLE></HEAD>");
> out.println("<BODY><UL>");
> while(rs.next())
> {
> out.println("<LI>" + rs.getString("fname")
+ " " + rs.getString("lname"));
> }
> out.println("</UL>");
> out.println("</BODY></HTML>");
> }
> /* catch (ClassNotFoundException e)
> {
> out.println("Could not load the database driver: "
+ e.getMessage());
> } */
> catch (SQLException e)
> {
> out.println("SQLException caught: " +
e.getMessage());
> }
> finally
> {
> file://Close all database connection.
> try
> {
> if (con != null)
> con.close();
> }
> catch (SQLException e)
> {
> out.println("SQLException caught: " +
e.getMessage());
> }
> }
> }
> }
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html