0

I'm working in a database with multiple databases, I'm not really sure what to call it since I am new to this kind of database layout, but basically there is a variable in the database URL that the user inputs for example:

 jdbc:db2//$$variable$$.$$variable$$...

It's a single variable, so the user only gets prompted once. My issue is that I have to go into about 44 of these "databases?" and do the same query looking for a certain record that exists. I was just wondering if there is an easier way to query multiple "databases" without having to disconnect and reconnect then enter the next variable, and re execute the query.

I'm using DB2 on Db Visualizer 9.0.5 if that is any help.

Sewder
  • 754
  • 3
  • 11
  • 37
  • I suggest that you create specific database connections for all of your 44 connections. Then use the command line interface wrapped in some basic script code to run the queries automatically. The script can then verify the output of each query and present the results nicely. You just need to launch the script. Read more about the command line interface here: http://confluence.dbvis.com/display/UG91/Command+Line+Interface – roger Apr 08 '14 at 10:54
  • If you are familiar with a 'scripting' language such as `ruby` you could write a short program to connect to each database in turn and execute a given query against each. However unless you are going to repeat this exercise, and there is some sort of sequential naming standard for the databases, this may be more effort than just doing it "manually". – Turophile Apr 10 '14 at 07:23

0 Answers0