Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
5 replies Latest Post - ‏2013-03-08T16:55:36Z by Jim Sharpe
Jim Sharpe
Jim Sharpe
98 Posts
ACCEPTED ANSWER

Pinned topic Using both DB2 and SolidDB with the DB toolkit.

‏2013-03-01T17:07:57Z |
We would like to interface with both DB2 and SolidDB (for more than just SolidDBEnrich) from different jobs in the same Streams instance.

The DB toolkit documentation indicates that we can set "exactly one of the environment variables" leading me to believe that I'll need to set STREAMS_ADAPTERS_ODBC_OTHER and use the unixODBC drivers for both DB2 and solidDB. Is that correct, or is there someway to use both the specific DB2 and SolidDB drivers directly?
  • maccola
    maccola
    20 Posts
    ACCEPTED ANSWER

    Re: Using both DB2 and SolidDB with the DB toolkit.

    ‏2013-03-04T15:24:03Z  in response to Jim Sharpe
    The environment variables you are referring to are needed at compile time, but not at runtime. As long as you do not need to access solidDB and DB2 from the same job, you should be able to compile each application with the environment variable corresponding to the needed DB.
  • pcbye
    pcbye
    26 Posts
    ACCEPTED ANSWER

    Re: Using both DB2 and SolidDB with the DB toolkit.

    ‏2013-03-04T15:25:13Z  in response to Jim Sharpe
    Hello,

    Your assessment is correct - currently the DB Toolkit only allows one database driver to be used at compile time (and thus at runtime) so the only way "around" the restriction is to use STREAMS_ADAPTERS_ODBC_UNIX_OTHER. The only other potential way around it would be to have two applications and use import/export for streams between them, which is kind of messy for this.

    Unfortunately, the problem is more difficult to fix with than just making some code changes to allow multiple drivers to be used - if different drivers are used, that means linking to different libraries and using different include files, so it would mean the PEs would need to be separate executables - i.e. no standalone or fused mode.
    • Jim Sharpe
      Jim Sharpe
      98 Posts
      ACCEPTED ANSWER

      Re: Using both DB2 and SolidDB with the DB toolkit.

      ‏2013-03-04T21:36:33Z  in response to pcbye
      Thanks Michael and Paul for your help.

      From the combination of your answers it does sound feasible since I can easily live with having separate jobs access the two different kinds of databases. Now I just need to figure out the details on exactly how to do that. I would prefer to do it from within Streams studio rather that having to compile one of them separately (after changing the environment variables of course). So my first thought was that I could use the Streams Studio build configuration to set a command line option for the sc command or perhaps even specify environment variable values there. But after looking through the things available, I didn't see anything appropriate. So a second option would seem to be to manually (outside of Studio) build one of the jobs, e.g., the one talking to DB2 after temporarily changing the environment variables. For that scenario I figure I'd need to at least turn off the "Build automatically" option since that seems to be global to the workspace as rather than specific to each application and so leaving it enabled would mess things up if both jobs were built using the same environment options. But assuming I did turn off that option, it seems that I should still be able to launch and terminate both the SolidDB and DB2 applications from within the same workspace. Is that correct or did I miss something? Also are there any considerations I would need to be aware of when launching/administering the two jobs via the Streams console?

      The above all relates to build time, but I also have some implementation questions regarding run time. Specifically, as a matter of style, should I plan on using separate connection.xml files for the two different jobs (i.e., one for SolidDB and a different one for DB2) even though they are both using the same unixODBC driver?

      Given the nature of Streams for interfacing with many different data sources/sinks (I didn't even bring up Oracle and Netezza, although they are also on the horizon), it would be nice if, in the future, there were a cleaner way to simultaneously accommodate multiple data base drivers with the DB toolkit.
      • maccola
        maccola
        20 Posts
        ACCEPTED ANSWER

        Re: Using both DB2 and SolidDB with the DB toolkit.

        ‏2013-03-07T21:26:31Z  in response to Jim Sharpe
        To set the environment variables for the different applications (using different DBs) within the IDE, I believe you will have to set up external builder using makefiles.

        I don't think there should be issue with having 1 connection.xml document for the two database connections. Obviously you would two different connection sections within the xml.
        • Jim Sharpe
          Jim Sharpe
          98 Posts
          ACCEPTED ANSWER

          Re: Using both DB2 and SolidDB with the DB toolkit.

          ‏2013-03-08T16:55:36Z  in response to maccola
          I understand. It sounds like it should be possible and I have a general understanding of things to try so I'm going to mark this question answered while I try it over the next week or so. I may end up opening a different more specific question if I get stuck though.