In any type of application (web/ desktop) which one is the best ?
1. making and closing the connection with database for each and every use.
or
2. make a connection and use that connection until the end of application.
or
3. whether, it depends upon the data source and/or application.?
Of course it will affect performance--opening and closing a connection takes time.
So, since your question was completely generic and provided zero useful information, the answer is "it depends". Sure sounds like an interview question to me, since you're not asking anything specific.
A Santini
Greenhorn
Joined: Sep 22, 2010
Posts: 3
posted
0
Create a connection pool and get and close a connection.
A Santini
Greenhorn
Joined: Sep 22, 2010
Posts: 3
posted
0
Sorry to resurrect an old thread. I'm new here and the sort is all screwed up. Should be sorted by date..or at least thats what Im used to.