|

06-09-2009, 09:49 PM
I agree. I just joind this forum, and if that is the quality and tone of response I can expect from the MODERATOR I doubt I'll be spending much time here. He might at least have provided a link to the topic in the, er, FM.
elicia (if you're even bothering to follow this thread after being flamed),
You need to create a datasource configuration for Tomcat. The contents vary by database, but at minimum you need to specify the driver name and the URL for the database, just as you would when using driver manager. Define a resource ref for the datasource in your web.xml so you can look it up by its JNDI name from your application code. You'd then call getConnection() on the returned datasource, optionally providing an id and password (the datasource could provide these, too).
You should be able to find many samples on he web if you search "tomcat MySQL datasource".
If you just want to access the database from within eclipse (rather than from a web application) you'll find that more straightforward with WTP (Ganymede) or MyEclipse than vanilla eclipse. To get your feet wet you might play around with an apache derby database first (install the plugins, then right-click on your project and look for the "Apache Derby... Add Apache Derby Nature" selection in the context menu).
Good luck!
|