I have to connect to some 200 DB2 Databases and pull meta data and store those data in another Master SQL Server for reporting purposes. Now, when a user clicks "run a script". The Application should get connected to one DB2 Database pull data, store it in Master SQL Server. After that, again connecting to next DB2 Database and the process goes on. It will be very helpful if someone can suggest the best possible method to store and dynamically change these connection strings one after another when the script is running. We also have to add or remove as and when new databases are turned over to us or remove if decommissioned.
-
You've got a DB, so you can probably just store these in a table.Bernhard Barker– Bernhard Barker2013-10-21 15:11:34 +00:00Commented Oct 21, 2013 at 15:11
-
Thanks Dukeling, so you trying to say store the connection string parameters in a separate table and read it through resultset and construct the connection string and connect?Arijit Ghosh– Arijit Ghosh2013-10-21 15:15:07 +00:00Commented Oct 21, 2013 at 15:15
-
Yes, that's one option. Another is to just put them in a file somewhere.Bernhard Barker– Bernhard Barker2013-10-21 15:19:09 +00:00Commented Oct 21, 2013 at 15:19
-
ok..thanks..Performancewise which will be faster? since its a matter of 200+ DBs.Arijit Ghosh– Arijit Ghosh2013-10-21 15:22:52 +00:00Commented Oct 21, 2013 at 15:22
-
We're talking about reading 200 fairly short strings (and then, for each of these, connecting to another database, which would be slower) - either should be fast enough.Bernhard Barker– Bernhard Barker2013-10-21 15:27:49 +00:00Commented Oct 21, 2013 at 15:27
|
Show 1 more comment
1 Answer
If you use xml, it is relatively very easy to manage. Just store each connection string as a node like below
<connectionStrings>
<connectionString />
<connectionString />
<connectionString />
<connectionString />
<connectionString />
</connectionStrings>
Now from your application (any language that can consume XML) loop through every connectionstring node and write logic to connect and store meta data within the loop.
Your task is done.
1 Comment
Arijit Ghosh
Thanks Bepenfriends..but storing connection string parameters in xml, is it safe or reliable? (security aspect)