Connection string, where to store ?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Connection string, where to store ?

  1. #1
    Sergio Pereira Guest

    Connection string, where to store ?

    Hi.
    I'd like to read from you opinions regarding where to store the connection
    string setting on a n-tier application. Currently I use the windows registry
    of the application server (COM+) machine, and all my objects read that
    setting before opening any connection. Does it affect the system
    performance? Do you have any comments or other suggestions?
    I've seen people store the connection string in a .asp include file and pass
    the connection string as a parameter to the methods in the objects.

    Thanks a lot!

    -------------------------------------------------
    Sergio Pereira
    Consultant
    Neumark Technology Group, Inc.




  2. #2
    John Cantley Guest

    Re: Connection string, where to store ?

    Sergio,

    I have started using XML for all my application settings.

    John



  3. #3
    ian drake Guest

    Re: Connection string, where to store ?


    Sergio -

    You could use COM+ constructor string to administrativly assign a connection
    string if you have objects hosted in COM+. Also you can use a UDL file.
    This will atomatically be cached by the system and you just specify your
    connection string as "file name=C:\my\path\myUDL.udl". The udl file has
    all the connection info in it. You must be carefull not to expose that UDL
    file in any way to the outside world. This is one reason that it is not
    a good idea to put it in an ASP file. Some one could get the source to that
    file through an IIS hack. Then they know more than you'd like them too.

    Hope this help,
    Ian Drake



  4. #4
    Sergio Pereira Guest

    Re: Connection string, where to store ?

    John,
    So you objects access the file, parse it and extract the connection string
    on every need for a connection or do you cache the connection string somehow
    ?
    The good thing about the registry is that is has a separate security setting
    and systems administrators are familiar with it.
    My concerns are security, performance and ease of administration (the later
    is not so important as the other two)

    Thaks for the feedback!

    Sergio

    "John Cantley" <jcstrider@hotmail.com> wrote in message
    news:3ac395fc$1@news.devx.com...
    > Sergio,
    >
    > I have started using XML for all my application settings.
    >
    > John
    >
    >




  5. #5
    Sergio Pereira Guest

    Re: Connection string, where to store ?

    Ian,
    This sounds great! If I use the connection string based on a UDL file then
    ADO/OLEDB will not read the file everytime I need a new connection? This
    would be fast.

    Thanks!

    Sergio

    "ian drake" <ian.drake1@home.com> wrote in message
    news:3ac39dda$1@news.devx.com...
    >
    > Sergio -
    >
    > You could use COM+ constructor string to administrativly assign a

    connection
    > string if you have objects hosted in COM+. Also you can use a UDL file.
    > This will atomatically be cached by the system and you just specify your
    > connection string as "file name=C:\my\path\myUDL.udl". The udl file has
    > all the connection info in it. You must be carefull not to expose that

    UDL
    > file in any way to the outside world. This is one reason that it is not
    > a good idea to put it in an ASP file. Some one could get the source to

    that
    > file through an IIS hack. Then they know more than you'd like them too.
    >
    > Hope this help,
    > Ian Drake
    >
    >




  6. #6
    ian drake Guest

    Re: Connection string, where to store ?


    Sergio -

    If you are going to use a UDL, just NEVER move that udl file from the place
    where you started using it to a new location. Because it's cached wierd
    things start happening. All you'll have to do is recreate that UDL file
    in the new location. I got very criptic errors when I moved a udl file after
    it had been used. It's just strange, so watch out.

    Ian Drake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center