|
I am trying to setup some webpages hosted using Tomcat and I am
facing
problems to access the MySQL databse from the webpages. I have setup Tomcat-3.2.1(binary) and Apache_1.3.14 with MySQL-3.23.31 under RedHatLinux 6.2. Tomcat, Apache and MySQL are basically working fine whereas jdk1.3 is installed under /usr/java. I have to setup login authentication from the webpages accessing data from MySQL (name of database is test). I think Tomcat supports JDBC and not ODBC and therefore I am trying to use MM.MySQL for JDBC connectivity to MySQL. I am having lack of understanding how to properly setup MM.MySQL in conjunction with Tomcat. 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. Unpacked mm.mysql.jdbc-1.2c.tar.gz under /opt 3. Have set up CLASSPATH as /opt/mm.mysql.jdbc-1.2c 4. Copied both mysql_comp.jar or mysql_uncomp.jar (one at a time) to $TOMCAT_HOME/lib When I am trying to access my webpages under Tomcat, I am getting an error message on the linux console as: java.sql.SQLException: No suitable driver Further when I am trying to access MySQL through my Tomcat webpages or trying to stop Tomcat, I am also getting error message as: java.lang.NullPointerException Do I need JDBCRealm.class file? If yes, how to get
and where to place? I have file under
$TOMCAT_HOME/src/org/apache/tomcat/request/JDBCRealm.java but if I try to
compile it, I am getting lots of errors.
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 WebPages. In the Linux setup in question, I have also installed ODBC driver and driver manager (libiodbc-2.50.3 and MyODBC-2.50.36) for MySQL and the sample odbctest program is able to access data from MySQL. However MySQL can not be accessed from the WebPages and I believe Tomcat need to configured to work with the ODBC driver if at all it can support the ODBC. Tomcat documentation is referring the use of a JDBC driver MM.MySQL which is also installed here(mm.mysql.jdbc-1.2c) under Linux. But the documentations are not that clear to me and I am unable to understand and complete the associated configuration. Can somebody help? Thanks a million in advance. Dipankar |
- JDBCRealm - can't make it work Dipankar Sinha
- JDBCRealm - can't make it work Dipankar Sinha
