473,506 Members | 17,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OdbcConnections - more or less?

52 New Member
Performance speaking, is it better to stick with one connection or use a different one for each task?

In my case I have something like:


Expand|Select|Wrap|Line Numbers
  1.  
  2. string query = ...
  3. OdbcDataReader reader = connectionA -> read query
  4.  
  5. while (reader.Read())
  6. {
  7.     ...
  8.  
  9.     query = ...
  10.     OdbcDataReader reader2 = connectionB -> read query
  11.  
  12.     if (reader.Read())
  13.     {
  14.         ...
  15.     }
  16. }
  17.  
Should I use the same connection for A and B or different, or should I create a new connection for B for each loop?

Thanks :) ,



Billy
Jan 14 '09 #1
3 1001
liawcv
33 New Member
Connect to database?

For me, I will use a single Connection object, for database connection may be limited. And I will join 2 tables as a view (provided logically possible), so I can use just one DataReader to get the job done.
Jan 14 '09 #2
200dogz
52 New Member
Thanks for the suggestion :)
Jan 14 '09 #3
vinot85
53 New Member
Limiting the connections to a database is always advisable. Because it increases the performance of the application thereby decreasing the database server load.
Jan 14 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
2645
by: Ridimz | last post by:
I have implemented a binary search tree and am interested in displaying all keys less than a certain value. I understand how to approach this task if the searchValue is equal to root.key()....
0
2026
by: fake ID | last post by:
Since you can't search for these symbols used in asp.net "<%#" or '<%=' I thought i'd post this to make things a little easier to find. Potential search word combinations: -lessthan Percentage...
11
8737
by: Martin Jørgensen | last post by:
Hi, - - - - - - - - - - - - - - - #include <iostream> #include <string> #include <map> using namespace std; int main() {
26
3183
by: Christoph Zwerschke | last post by:
You will often hear that for reasons of fault minimization, you should use a programming language with strict typing: http://turing.une.edu.au/~comp284/Lectures/Lecture_18/lecture/node1.html I...
8
9609
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
16
5031
by: Cory Nelson | last post by:
Does anyone know how std::set prevents duplicates using only std::less? I've tried looking through a couple of the STL implementations and their code is pretty unreadable (to allow for different...
3
2265
by: ek | last post by:
I have the following class: template<typename I> class test { public: test(I i) : pp(i) {} I getpp() const { return pp; }
2
2893
by: desktop | last post by:
I get this error when I run my program: red_black_tree.cpp:188: error: no matching function for call to ‘std::less<MyObj<int::less(MyObj<int>&, MyObj<int>&)’...
1
1897
by: gnidoc | last post by:
This is a small perl script I wrote to check mirror lists (files filled with one URL per line). It prints " http://..." when an URL can't be retrieved and just prints the url when everything goes...
5
3440
by: ukfusion | last post by:
I have an sql query which has several fields and no matter how hard i try i cant get the less than statement to work....i originally tried between but that wouldnt work either. $yourpricesearch is...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.