You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tony Keith <to...@paycom.net> on 2000/11/16 18:58:41 UTC

How to configure Mysql with Tomcat.

Hello,

I wrote a simple servlet to insert a row into a mysql database table.
I'm running Tomcat 3.2b7.

What are the steps to configure Tomcat to work with this servlet?
The problem I'm having now is the driver isn't found.

Where do I place the driver? In the lib directory?

How do I reference a new instance of the driver?
This is how I reference it now:
Class.forName("org.mm.mysql.Driver").newInstance();

Will the connection information remain the same?
Here is the connection information I currently use:
con = DriverManager.getConnection("jdbc:mysql://localhost/webdata",
"user", "password");

TIA
--
Tony Keith




Re: How to configure Mysql with Tomcat.

Posted by Dave Harms <jd...@clarionmag.com>.
Tony,

> connPool[i]=DriverManager.getConnection("jdbc:mysql://"+dbServer+"?user="+db
> 
> Login); 
> As for connecting with a non-empty password, I don't know
> how to do that. 
> If you figure it out, please let me know.
>

Passing the userid and password separately works fine for me:

   connection = DriverManager.getConnection(connectionURL,
    "userid", "password");
    

Dave

Dave Harms
jdev@clarionmag.com


Re: How to configure Mysql with Tomcat.

Posted by Tony Keith <to...@paycom.net>.
Zebadiah Kimmel wrote:

> The following code should work if your database's root password is empty:
>
> Class.forName(dbDriver).newInstance();

My problem is the driver isn't being loaded.
Configuration problems, I believe...

>
> connPool[i]=DriverManager.getConnection("jdbc:mysql://"+dbServer+"?user="+db
> Login);
>
> As for connecting with a non-empty password, I don't know how to do that.
> If you figure it out, please let me know.
>
> --Zeba
>
> At 09:58 AM 11/16/00 -0800, Tony Keith wrote:
> >Hello,
> >
> >I wrote a simple servlet to insert a row into a mysql database table.
> >I'm running Tomcat 3.2b7.
> >
> >What are the steps to configure Tomcat to work with this servlet?
> >The problem I'm having now is the driver isn't found.
> >
> >Where do I place the driver? In the lib directory?
> >
> >How do I reference a new instance of the driver?
> >This is how I reference it now:
> >Class.forName("org.mm.mysql.Driver").newInstance();
> >
> >Will the connection information remain the same?
> >Here is the connection information I currently use:
> >con = DriverManager.getConnection("jdbc:mysql://localhost/webdata",
> >"user", "password");
> >
> >TIA
> >--
> >Tony Keith

--
Tony Keith
Director of Information Technology
Paycom.net
4215 Glencoe Avenue, First Floor
Marina Del Rey, CA  90292
TEL: (310) 827-5880 ext. 304
FAX: (310) 827-5519



Re: How to configure Mysql with Tomcat.

Posted by Zebadiah Kimmel <zk...@zebware.com>.
The following code should work if your database's root password is empty:

Class.forName(dbDriver).newInstance();
connPool[i]=DriverManager.getConnection("jdbc:mysql://"+dbServer+"?user="+db 
Login);

As for connecting with a non-empty password, I don't know how to do that. 
If you figure it out, please let me know.

--Zeba

At 09:58 AM 11/16/00 -0800, Tony Keith wrote:
>Hello,
>
>I wrote a simple servlet to insert a row into a mysql database table.
>I'm running Tomcat 3.2b7.
>
>What are the steps to configure Tomcat to work with this servlet?
>The problem I'm having now is the driver isn't found.
>
>Where do I place the driver? In the lib directory?
>
>How do I reference a new instance of the driver?
>This is how I reference it now:
>Class.forName("org.mm.mysql.Driver").newInstance();
>
>Will the connection information remain the same?
>Here is the connection information I currently use:
>con = DriverManager.getConnection("jdbc:mysql://localhost/webdata",
>"user", "password");
>
>TIA
>--
>Tony Keith