Results 1 to 5 of 5

Thread: Connection

  1. #1
    kotkot310 is offline Member
    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0

    Default Connection

    Dears ,

    i have an application witch connect to the SQLserver DB every 10 Second
    so my question is which is the best from the below options :
    1 ) open a new connection every 10 second and close it after finish
    2 ) Open the connection when the application open and close only when the app close

    so i am waiting for your repy

    thanks

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    2 ) Open the connection when the application open and close only when the app close

  3. #3
    kotkot310 is offline Member
    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0

    Default

    Thank you for Reply but may i ask why the second is better than the first?

  4. #4
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    830
    Rep Power
    6

    Default

    Database connections are costly and it hits the performance if u keep it open for long.
    Ramya:cool:

  5. #5
    kotkot310 is offline Member
    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0

    Default

    thank you ramya for your reply
    But open connections and close will not be costly to???

Similar Threads

  1. connection to database
    By buston01 in forum JDBC
    Replies: 4
    Last Post: 02-21-2010, 01:32 AM
  2. Replies: 7
    Last Post: 10-20-2009, 10:34 AM
  3. TCP Connection
    By Blacknight in forum New To Java
    Replies: 3
    Last Post: 06-04-2009, 01:02 PM
  4. Keep my TCP connection alive
    By eggmanpete in forum Advanced Java
    Replies: 4
    Last Post: 03-02-2009, 06:11 AM
  5. no connection
    By even in forum JDBC
    Replies: 15
    Last Post: 01-02-2008, 01:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •