tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shun-Luoi Daniel Fong <>
Subject db driver unavailable
Date Mon, 16 Apr 2001 21:24:43 GMT
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

1. In /home/httpd/html/gamezone/login.jsp, I have the following lines at
the beginning of the file:

< import="java.sql.*" errorPage="error.jsp" />
<jsp:useBean id="connection" class="ConnectionBean" scope="session" />

2. In /home/httpd/html/gamezone/WEB-INF/classes/, 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="";
  private static final String dbURL="jdbc:mysql://";
  private static final String login="guest";
  private static final String password="guest";
  public ConnectionBean() {
    try {
    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.


D. Shun-Luoi Fong
821 Melrose Avenue
Iowa City, IA 52246

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.

View raw message