This is just a guess, but your JAR file name has src in it, usually
indicating a source of some sort. Tomcat (nor any other JSP/servlet engine
that I know of) will not compile source into class files with the exception
of JSP. You probably need to either download the binary version, or build
the JAR from source (or it might be in the JAR you already have).
You should be able to use the JAR in the WEB-INF/lib directory,
unlike someone else mentioned.
Randy
> -----Original Message-----
> From: Shun-Luoi Daniel Fong [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 16, 2001 5:25 PM
> To: [EMAIL PROTECTED]
> Subject: db driver unavailable
>
>
> I hope this isn't a question I should have just figured out
> myself, but
> either way...
>
> I have a login.jsp where the user can enter their id and
> password and hit
> the form's button to submit. It then goes to checklogin.jsp
> where the form
> data is grabbed, then sent to a database to verify that the
> id/password
> are in the db.
>
> To test, I am using the JavaBean from "Web Development with JavaServer
> Pages" by Fields/Kolb, called ConnectionBean.java
>
> 1. In /home/httpd/html/gamezone/login.jsp, I have the
> following lines at
> the beginning of the file:
>
> <jsp:directive.page import="java.sql.*" errorPage="error.jsp" />
> <jsp:useBean id="connection" class="ConnectionBean" scope="session" />
>
>
> 2. In /home/httpd/html/gamezone/WEB-INF/classes/ConnectionBean.java, I
> have the following(regarding the connection):
>
> import java.sql.*;
> import javax.servlet.http.*;
>
>
> public class ConnectionBean implements HttpSessionBindingListener {
> private Connection connection;
> private Statement statement;
>
> private static final String driver="org.gjt.mm.mysql.Driver";
> private static final String
> dbURL="jdbc:mysql://agent.eng.uiowa.edu/gzuser_db";
> private static final String login="guest";
> private static final String password="guest";
>
> public ConnectionBean() {
>
> try {
> Class.forName(driver);
> connection=DriverManager.getConnection(dbURL,login,password);
> statement=connection.createStatement();
> }
> catch (ClassNotFoundException e) {
> System.err.println("ConnectionBean: driver unavailable");
> connection = null;
> }
> catch (SQLException e) {
> System.err.println("ConnectionBean: driver not loaded");
> connection = null;
>
>
> 3. When I load login.jsp in the browser, I get the error
> ConnectionBean: driver unavailable
> ConnectionBean: in the valueBound method
>
>
> 4. I placed the mm.mysql-2.0.4-src.jar file in WEB-INF/lib so
> that the db
> driver could be found.
>
> 5. I'm using Tomcat 3.2.1/Apache/Linux
>
> Could somebody tell me what I'm doing wrong? I realize that it is the
> ClassNotFoundException but I'm not sure what I need to do to
> fix it. If
> you need more info from me, I'd be more than happy to provide it.
>
> Thanks,
> Luoi
>
>
> --
> D. Shun-Luoi Fong
> 821 Melrose Avenue
> Iowa City, IA 52246
> email: [EMAIL PROTECTED]
>
> -----------------------
> Colossions 2:8 See to it that no one takes you captive
> through philosophy
> or empty deception, according to the traditions of men,
> according to the
> elementary principles of the world, rather than according to Christ.
> -----------------------
>
>