You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dipankar Sinha <di...@stssoftware.com> on 2001/02/05 00:22:46 UTC

JDBC connectivity - java.sql.SQLException: No suitable driver

I am trying to host some webpages using Tomcat and when my webpage is being accessed, I am getting an error message on the linux console as: 
java.sql.SQLException: No suitable driver

I have setup Tomcat-3.2.1 and Apache_1.3.14 with MySQL-3.23.31 under RedHatLinux 6.2. 
jdk1.3 is installed under /usr/java. 
Tomcat, Apache and MySQL are basically working fine
I have to setup login authentication from the webpages accessing data from MySQL (name of database is test, no user, no password). 
I am trying to use MM.MySQL for JDBC connectivity to MySQL

As indicated in Tomcat/MM.MySQL documentation, I have tried as follows:

1. Modified $TOMCAT_HOME/conf/server.xml to add following lines:
        <RequestInterceptor
            className="org.apache.tomcat.request.JDBCRealm"
            debug="99"
            driverName="org.gjt.mm.mysql.Driver"
            connectionURL="jdbc:mysql://localhost/test''"
            />
2. I tried dropping mm.mysql-2.0.4-bin without un jaring under $TOMCAT_HOME/lib

Tomcat starts without any error but does not confirm Database connection.

Further when I am trying to stop Tomcat, I am getting additional error message as:
java.lang.NullPointerException

In a separate environment, I have used NT4.0, JavaWebserver, MySQL and ODBC
driver. Every thing is working over there including database access from the same
WebPages etc.

Can somebody help?
Thanks a million in advance.

Dipankar






Re: JDBC connectivity - java.sql.SQLException: No suitable driver

Posted by RK <v_...@hotmail.com>.
Please check classpath. Before testing any jdbc connection using Tomcat, I run a simple java program that does dblook-up outside of Tomcat. This helps resolve any classpath/driver issues.


  ----- Original Message ----- 
  From: Dipankar Sinha 
  To: tomcat-user@jakarta.apache.org 
  Cc: Ignacio J. Ortega 
  Sent: Sunday, February 04, 2001 3:22 PM
  Subject: JDBC connectivity - java.sql.SQLException: No suitable driver


  I am trying to host some webpages using Tomcat and when my webpage is being accessed, I am getting an error message on the linux console as: 
  java.sql.SQLException: No suitable driver

  I have setup Tomcat-3.2.1 and Apache_1.3.14 with MySQL-3.23.31 under RedHatLinux 6.2. 
  jdk1.3 is installed under /usr/java. 
  Tomcat, Apache and MySQL are basically working fine
  I have to setup login authentication from the webpages accessing data from MySQL (name of database is test, no user, no password). 
  I am trying to use MM.MySQL for JDBC connectivity to MySQL

  As indicated in Tomcat/MM.MySQL documentation, I have tried as follows:

  1. Modified $TOMCAT_HOME/conf/server.xml to add following lines:
          <RequestInterceptor
              className="org.apache.tomcat.request.JDBCRealm"
              debug="99"
              driverName="org.gjt.mm.mysql.Driver"
              connectionURL="jdbc:mysql://localhost/test''"
              />
  2. I tried dropping mm.mysql-2.0.4-bin without un jaring under $TOMCAT_HOME/lib

  Tomcat starts without any error but does not confirm Database connection.

  Further when I am trying to stop Tomcat, I am getting additional error message as:
  java.lang.NullPointerException

  In a separate environment, I have used NT4.0, JavaWebserver, MySQL and ODBC
  driver. Every thing is working over there including database access from the same
  WebPages etc.

  Can somebody help?
  Thanks a million in advance.

  Dipankar






Re: JDBC connectivity - java.sql.SQLException: No suitable driver

Posted by thambi <th...@space2host.com>.
give the the path of mySQL driver JAR file in the CLASSPATH in the tomcat.sh  file which is used to start tomcat 

thambi
  ----- Original Message ----- 
  From: Dipankar Sinha 
  To: tomcat-user@jakarta.apache.org 
  Cc: Ignacio J. Ortega 
  Sent: Monday, February 05, 2001 4:52 AM
  Subject: JDBC connectivity - java.sql.SQLException: No suitable driver


  I am trying to host some webpages using Tomcat and when my webpage is being accessed, I am getting an error message on the linux console as: 
  java.sql.SQLException: No suitable driver

  I have setup Tomcat-3.2.1 and Apache_1.3.14 with MySQL-3.23.31 under RedHatLinux 6.2. 
  jdk1.3 is installed under /usr/java. 
  Tomcat, Apache and MySQL are basically working fine
  I have to setup login authentication from the webpages accessing data from MySQL (name of database is test, no user, no password). 
  I am trying to use MM.MySQL for JDBC connectivity to MySQL

  As indicated in Tomcat/MM.MySQL documentation, I have tried as follows:

  1. Modified $TOMCAT_HOME/conf/server.xml to add following lines:
          <RequestInterceptor
              className="org.apache.tomcat.request.JDBCRealm"
              debug="99"
              driverName="org.gjt.mm.mysql.Driver"
              connectionURL="jdbc:mysql://localhost/test''"
              />
  2. I tried dropping mm.mysql-2.0.4-bin without un jaring under $TOMCAT_HOME/lib

  Tomcat starts without any error but does not confirm Database connection.

  Further when I am trying to stop Tomcat, I am getting additional error message as:
  java.lang.NullPointerException

  In a separate environment, I have used NT4.0, JavaWebserver, MySQL and ODBC
  driver. Every thing is working over there including database access from the same
  WebPages etc.

  Can somebody help?
  Thanks a million in advance.

  Dipankar






Installing in Redhat 7.0

Posted by "Peter B. West" <pb...@powerup.com.au>.
I seem to have successfully installed tomcat and cocoon in a Redhat 7.0
system.  I used Henri Gomez' rpms.  One comment on the contents of
/etc/httpd/conf/workers.properties file.  It contained

#
# The JVM that we are about to use
#
# This is for Java2
#
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll

Is this value used?  I replaced the .dll with libjvm.so

One other comment.  After installing cocoon 1.8.1, I was trying to
access Cocoon.xml as localhost/Cocoon.xml.  This did not work, but
localhost/cocoon/Cocoon.xml did.  I seem to recall the
localhost/Cocoon.xml worked when using mod_jserv.

Peter
-- 
Peter B. West  pbwest@powerup.com.au  http://powerup.com.au/~pbwest
"Lord, to whom shall we go?"

Re: JDBC connectivity - java.sql.SQLException: No suitable driver

Posted by George Shafik <gs...@optusnet.com.au>.
Check your "classpath". Make sure that the JDBC jar file specified in your "classpath" is one in the same as that used by the development tool you are using to develop your Java app.

Cheers,
George
  ----- Original Message ----- 
  From: Dipankar Sinha 
  To: tomcat-user@jakarta.apache.org 
  Cc: Ignacio J. Ortega 
  Sent: Monday, February 05, 2001 10:22 AM
  Subject: JDBC connectivity - java.sql.SQLException: No suitable driver


  I am trying to host some webpages using Tomcat and when my webpage is being accessed, I am getting an error message on the linux console as: 
  java.sql.SQLException: No suitable driver

  I have setup Tomcat-3.2.1 and Apache_1.3.14 with MySQL-3.23.31 under RedHatLinux 6.2. 
  jdk1.3 is installed under /usr/java. 
  Tomcat, Apache and MySQL are basically working fine
  I have to setup login authentication from the webpages accessing data from MySQL (name of database is test, no user, no password). 
  I am trying to use MM.MySQL for JDBC connectivity to MySQL

  As indicated in Tomcat/MM.MySQL documentation, I have tried as follows:

  1. Modified $TOMCAT_HOME/conf/server.xml to add following lines:
          <RequestInterceptor
              className="org.apache.tomcat.request.JDBCRealm"
              debug="99"
              driverName="org.gjt.mm.mysql.Driver"
              connectionURL="jdbc:mysql://localhost/test''"
              />
  2. I tried dropping mm.mysql-2.0.4-bin without un jaring under $TOMCAT_HOME/lib

  Tomcat starts without any error but does not confirm Database connection.

  Further when I am trying to stop Tomcat, I am getting additional error message as:
  java.lang.NullPointerException

  In a separate environment, I have used NT4.0, JavaWebserver, MySQL and ODBC
  driver. Every thing is working over there including database access from the same
  WebPages etc.

  Can somebody help?
  Thanks a million in advance.

  Dipankar