Hu guys.,
I am developing an application that needs to connect to some databases (not as usuall to one). I have developed a class that swaps between the two databases by first closing the first database and then opens the second and finally close the second and opens the first. I wonder whether this is the best approach and whether this is the best approach and whether it consumes a lot of power?
Multiple connections
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Do you use the same connection parameters for both? Parameters being username, password, server string and port. If so, you can query the database without changing the current one.
Code: Select all
SELECT fieldName from databaseName.tableName ...