File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Loading Driver Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Loading Driver Problem" Watch "Loading Driver Problem" New topic

Loading Driver Problem

El Russell

Joined: Sep 30, 2001
Posts: 2
I am not able to load the database driver with the following setup: Apache JServ and GNUJSP, the mm.mysql-2.0.4 driver and jdk1.1.8 running under FreeBSD.
The code to load the driver is:
<%@page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*"%>
<%@ include file="Connections/connZeagleJSP.jsp" %>
<%<br /> // *** Validate request to log in to this site.<br /> String MM_LoginAction = request.getRequestURI();<br /> if (request.getQueryString() != null && request.getQueryString().length() > 0) MM_LoginAction += "?" + request.getQueryString();
String MM_valUsername=request.getParameter("user");
if (MM_valUsername != null) {
String MM_fldUserAuthorization="";
String MM_redirectLoginSuccess="dlr_welcome.jsp";
String MM_redirectLoginFailed="dlr_badlogin.jsp";
String MM_redirectLogin=MM_redirectLoginFailed;

Driver MM_driverUser = (Driver)Class.forName("").newInstance();

The driver location is specified in the CLASSPATH environment variable in the shell startup script. I have tried locating the driver in a variety of places and modifying the CLASSPATH each time. I still get the CassNotFound exception. Is there some reason why GNUJSP wouldn't be able to locate the driver?
Thanks for any help
Ranjith R

Joined: Sep 18, 2001
Posts: 22
dont have much idea but give this a try..

if you haven't included the whole path, including the jar file name in classpath variable do it..

ex: /usr/local/xx/yy/zz/driverfile.jar

try including the whole file path. instead of location.

Take care<BR>r@njith
El Russell

Joined: Sep 30, 2001
Posts: 2
Thanks very much, but I had tried that too!
I agree. Here's the link:
subject: Loading Driver Problem
It's not a secret anymore!