• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting a datasource started  RSS feed

Simon Harvey
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!