aspose file tools*
The moose likes Servlets and the fly likes Servlet  and database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet  and database" Watch "Servlet  and database" New topic
Author

Servlet and database

Harry Kong
Ranch Hand

Joined: Dec 06, 2002
Posts: 41
I am trying to setup a database for my servlet applications. Right now I am trying to set up MySQL, but it seems that it is quite cumbersome to set up. Is there any other free database I can set easily? Also, I am using Tomcat for my servlet container how would I go about connecting my app and the database? This is all under win 2000. Thanks for your help.


SCJP 1.4
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
There is HSQLDB. I haven't used it so I can't comment on how easy it is to set up.


Matthew Phillips
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I've not used the current version, but I can vouch that previous versions were easy to install (essentially just put a jar file somewhere in a classpath and maybe tweak a small configuration file). Give it a try!


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Harry Kong
Ranch Hand

Joined: Dec 06, 2002
Posts: 41
Sure I'll give it a try. I just downloaded it and it is only 1.3mb
Harry Kong
Ranch Hand

Joined: Dec 06, 2002
Posts: 41
Anyone tried MySQL?
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I've used it a bit with Tomcat 4.1.12.

The thing with mySQL that I always found frustrating is their docs. They are complete. And by complete, I mean a single HTML file has EVERYTHING you could possibly want to know about mySQL. Which makes the task of finding what you want a bit daunting.

It was a head-scratcher for me to get things set up, because they don't seem to have a nice 10 step summary of "how to get this up and running". I do recall finding something like that eventually, but it was buried quite a ways into the big huge HTML file.

What's the specific problem you're having with mySQL? Once it's up, it's fun to play with.
El Roy Cabildo
Greenhorn

Joined: Oct 19, 2002
Posts: 23
yup i use mysql for my database....just include it to your class path where you put your jdbc driver
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Way back when I was first trying this, I googled for help, and I just found again the one page that helped me the most: http://www.analysisandsolutions.com/code/mybasic.htm
Harry Kong
Ranch Hand

Joined: Dec 06, 2002
Posts: 41
Well, I don't have a specific problem per say. I am just trying to set it up and play with it. The problem was that when I was reading the accompanying document for Connector/J it was a little vague and didn't tell me much.
Thanks for the link, Mike!
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
dear harry
mySQL works quite fine with me, quite easy to setup too...even Connector/J is easy to run, just copy the jar in lib folder & tweak the classpath...
hth
MB


Malhar Barai
SOA & Java Book
Chris Stewart
Ranch Hand

Joined: Sep 14, 2002
Posts: 184
I also use MySQL with Tomcat. JDBC is a charm to use. As everyone has said before, be sure the MySQL driver jar file is in your classpath.
Sloan Bowman
Ranch Hand

Joined: Jan 21, 2003
Posts: 107
The only thing I would have to add to this is you can either put the .jar file in your $HOME/WEB-INF/lib which will make it local to your web application of you can put it in $CATALINA_HOME/common/lib which will make it global to all webapps. Just a side note if you are going to use this JDBC driver in javax.naming. you need to put it in common/lib/*.jar and reload tomcat.
Hope this helps some.
 
 
subject: Servlet and database