在哪里存储数据库字符串连接在java web应用程序? [英] where to store database string connection in java web app?

查看:194
本文介绍了在哪里存储数据库字符串连接在java web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要用java开始我的第一个项目



让我告诉我如何处理这些事情...



到目前为止,我已经在asp上使用由VB6组成的com +组件。



组件通过com +管理控制台注册与域用户,lile my_company_domain\my_app_account



组件从udl文件读取配置,配置为访问具有集成安全性的数据库。



我使用server.createobject调用asp的组件,组件运行指定的域帐户,所以每个DB访问都使用此帐户...



我喜欢这种方法如下:




  • 使用集成安全 - 没有sql用户


  • 不需要重新编译任何内容来更改db(编辑udl文件)或域帐户(编辑com +组件配置) $ b

  • 汇集的连接(因为我始终使用相同的连接字符串)


  • 生产人员可以更改配置,密码。

    好的,什么是在java上实现类似这样的最好的方式???



    我已经看到了关于Commons-DBCP的东西,是可能使用集成安全与此???



    非常感谢...



    -



    通过集成安全响应来添加



    我的意思是我只需要配置一个域帐户,没有sql服务器帐户,只是VB6 com +组件运行的帐户。



    好吧,也许这不是适当的术语,但我希望你得到的想法。 。

    解决方案


    1. 配置DataSource&

    2. 从应用程序服务器端的ConnectionPool。
    3. 从JNDI环境从您的Web应用程序获取DataSource。


    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...

    解决方案

    1. Configure DataSource & ConnectionPool on app-server side.
    2. Obtain DataSource from JNDI environment from your web-application.

    这篇关于在哪里存储数据库字符串连接在java web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆