• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Using a Datasource to connect to database

Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the jtds driver for sql server.
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic