Set up the database connection pool or resource and make it available via JNDI. You can use spring to configure the connection string if you don't have an application container. If you do, for example in glassfish, you can setup your database resources and connection pools and assign them jndi names from the admin console. These will then be easily retrievable from your application if you make the jndi name well known.
John Ellinwood
2009-04-10 17:10:07