Firstly I very strongly highly recommend you buy a decent book on servlets with
a section on JDBC 
  The O'Reilly  book Java Servlet Programming - by Jason Hunter is a good one.

On Thu, 15 Mar 2001, you wrote:
> Hi I am using MySQL and JDBC mm.mysql Driver to connect to the database. I am 
> having trouble trying to connect. Can anyone tell me if MySQL is even 
> compatible with servlets????? 

It is not a question of whether it is compatible with servlets. Anything you
can do in Java can be done in a servlet. So can you connect from 
Java to MySql? Yes - this is what the mm.mysql Driver is specifically 
designed to facilitate.
With the distribution I have all I needed to was put mysql.jar in
TOMCAT_HOME/lib - documentation which you got with mysql 
will tell you how to register this driver in your Java code 
The jar file you have may be called something different.

>From the JDBC mm.mysql Driver it looks as if it 
> is. Also in one of the emails I saw a sample script and they used this driver 
> :
> 
>     "sun.jdbc.odbc.JdbcOdbcDriver"
> 
> I've seen that driver a lot before in documentations. What database does it 
> work with. And is that database easier to implement than MySQL.

It will work with any ODBC compliant database. It comes with your jdk which is
why you will see it a lot in documentation. However it is not recomended you
use it in a real system as it is not thread-safe. It is a lowest common
denominator driver so that you can start using Java to connect to db's
without obtaining and possibly paying for a driver specific to your db. 


andrew 


Reply via email to