tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <d...@cornell.edu>
Subject Re: URGENT, Tomcat & MySQL problems
Date Tue, 23 Oct 2001 18:52:06 GMT
I did this install on my dev machine just recently.   First, if 
mm.mysql-2.0.4-bin.jar is one you downloaded, you need to unzip it and use 
the mm.mysql-2.0.4.jar file compressed inside it.  I don't quite know why 
they packaged it that way, but there it is.  The downloaded JAR file also 
contains source and docs all packaged up together.  

Then place mm.mysql-2.0.4.jar where it works best for you.  If you use 
container based security in Tomcat, then the JAR file needs to be in 
CATALINA_HOME$/common/lib so that Tomcat can use it as well as your app.  
Otherwise CATALINA_HOME$/lib or WEB-INF/lib should work depending on whether 
you want it available to all apps or just one.

Hope this helps you.

--David Smith

On Tuesday 23 October 2001 11:57 am, you wrote:
> Hi guys,
> I am getting the following error:
>
> javax.servlet.ServletException: No suitable driver
>         at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextIm
>pl.java:457) at
> org.apache.jsp.ivf_0005fclinic_0005fsearch$jsp._jspService(ivf_0005fclinic_
>0005fsearch$jsp.java:145) ..........
>
> and I believe that I have the driver installed in the
> correct place.  I am running Tomcat 4.0 with MySQL
> 3.23.43 with Redhat Linux 7.1.  I placed the
> 'mm.mysql-2.0.4-bin.jar' file in
> /usr/java/jdk1.3.1/jre/lib/ext directory (as
> instructed by some solutions in the mailing list) but
> the driver still will not work.
>
> In my 'server.xml' file I have the following Realm
> defined :
>
> <Realm
> className="org.apache.catalina.realm.JDBCRealm"
> debug="99"
>     connectionName="website"
>     connectionPassword="user"
>     driverName="org.gjt.mm.mysql.Driver"
>
> connectionURL="jdbc:mysql://linuxsvr.hfea.gov.uk/dba"
>               userTable="user" userNameCol="User"
> userCredCol="Password"/>
>
> In my .jsp page the extract where the exception occurs
> is :
>
>   String MM_centres_web_database_DRIVER =
> "org.gjt.mm.mysql.Driver";
>                 String
> MM_centres_web_database_USERNAME = "website";
>                 String
> MM_centres_web_database_PASSWORD = "user";
>                 String MM_centres_web_database_STRING
> = "jdbc:mysql://linuxsvr.hfea.gov.uk/dba";
>             // end
>             // HTML // begin
> [file="/Connections/centres_web_database.jsp";from=(10,2);to=(14,2)]
>                 out.write("\r\n\r\n\r\n\r\n  ");
>
>             // end
>             // HTML // begin
> [file="/ivf_clinic_search.jsp";from=(2,58);to=(3,0)]
>                 out.write("\r\n");
>
>             // end
>             // begin
> [file="/ivf_clinic_search.jsp";from=(3,2);to=(12,0)]
>
>                 Driver DriverRecordset1 =
> (Driver)Class.forName(MM_centres_web_database_DRIVER).newInstance();
>                 Connection ConnRecordset1 =
> DriverManager.getConnection(MM_centres_web_database_STRING,MM_centres_web_d
>atabase_USERNAME,MM_centres_web_database_PASSWORD); PreparedStatement
> StatementRecordset1
> = ConnRecordset1.prepareStatement("SELECT * FROM
> DBA.region_pg");
>                 ResultSet Recordset1 =
> StatementRecordset1.executeQuery();
>                 boolean Recordset1_isEmpty =
> !Recordset1.next();
>                 boolean Recordset1_hasData =
> !Recordset1_isEmpty;
>                 Object Recordset1_data;
>                 int Recordset1_numRows = 0;
>             // end
>
> I have completely run out of ideas as to why this
> exception is occuring, I would be very grateful for
> any suggestions as my manager is breathing down my
> neck!
> Thanks again,
> Paul
>
>
>
> ____________________________________________________________
> Nokia Game is on again.
> Go to http://uk.yahoo.com/nokiagame/ and join the new
> all media adventure before November 3rd.


Mime
View raw message