aspose file tools*
The moose likes Tomcat and the fly likes Getting a datasource started Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Getting a datasource started" Watch "Getting a datasource started" New topic
Author

Getting a datasource started

Simon Harvey
Ranch Hand

Joined: Jan 26, 2003
Posts: 79
Hi everyone,
I'm making a small application in tomcat to get some practice with jsp. I really need some stratagy to using database connections because at the moment I have to set up a new connection every time I want to use the database.
So, I understand the concepts of connection pooling but when I looked a bit further I began to find information that suggested that I would need to setup a datasource. That sounded easy - I've done that with Access databases before in windows.
But this isnt the same and it look jolly scary!
Does anyone know of any decent resources on how to get tomcat talking to an sql server. It looks really complicated because I think that tomcat needs to interact with a j2ee server (I'm using the reference implementation at the moment). You seem to have to make loads of changes to tomcat config files and it just looks nuts.
As a brief aside, do you have to setup a datasource for each webapplication under tomcat. And also, does the connection mechanism kinda sit running under tomcat, and then your applications code says "ok, I need a connection now"
If anyone has any easier methodologies that they could point me towards, that would be great. I dont need a lightening fast database. Is there any easier solution? Could I for example, make my own basic pool in a javabean or something?
If not, can someone reasure me that this isnt as scary as it looks and tell me where to start!
Thanks everyone.
Take care
Simon
 
Consider Paul's rocket mass heater.
 
subject: Getting a datasource started