This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet and database

 
Harry Kong
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is HSQLDB. I haven't used it so I can't comment on how easy it is to set up.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Harry Kong
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure I'll give it a try. I just downloaded it and it is only 1.3mb
 
Harry Kong
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone tried MySQL?
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yup i use mysql for my database....just include it to your class path where you put your jdbc driver
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chris Stewart
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic