Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where to store database string connection in java web app?

I'm about to begin my first project with java

Let me tell how I used to handle these things...

So far now, I've been workin on asp with a com+ componente made with VB6.

The component is registered via the com+ administration console with a domain user, something lile my_company_domain\my_app_account

The components reads the configuration from an udl file, configured to access the DB with integrated security.

I invoke the componente from asp with server.createobject, the component runs with the specified domain account, and so every DB access runs with this account...

What I like from this approach is the following:

  • use of integrated security - no sql users

  • no need to recompile anything to change db (edit udl file) or domain account (edit com+ component configuration)

  • pooled connections (as I'm always using the same connection string)

  • production staff can alter the configuration without leaving the account password on a text file

...

well, what would be the best way to achieve something like this on java???

I've already saw something about Commons-DBCP, is it possible to use integrated security with this???

thanks a lot...

--

added in response to a comment

by integrated security I mean I only have to configure a domain account, and that's it, I use no sql server accounts, just the account under which the VB6 com+ component is run.

Ok, maybe that's not the appropiate term, but I hope you get the idea...

like image 466
opensas Avatar asked Jan 30 '09 06:01

opensas


1 Answers

  1. Configure DataSource & ConnectionPool on app-server side.
  2. Obtain DataSource from JNDI environment from your web-application.
like image 88
gedevan Avatar answered Oct 13 '22 00:10

gedevan