Connecting to DB2 on Unix box

  • I need to access tables on a DB2 database on a Unix box.  Perferably as a linked server.  The a WEB application on the Unix server is accessing the database via JDBC.  Anyone have any clues for me on this one?    I have never even seen this done and have no clue where to start.

     

    Thanks for any suggestions you may have.

  • Do you mean you have a Web Server that links to an SQL DB using JDBC and you want to expose the DB2 server from SQL? If so, then, search SQL Books Online for sp_addlinkedserver. You'll find a section on DB2.

    Once the linked server is created, you can access any DB2 table this way:

    select * from linkedservername.db2dbname.db2ownername.db2tablename

     

  • However if you are needing data from DB2 that is not being joined to data on the SQL Server I suggest using a direct connection to the DB2 server as you can run into issues with Linked servers stalling in SQL occasionally. Safer to do direct connection.

  • It's easy.

    First install the DB2 client on your SQLServer box.

    Then configure the access within Client Configuration Assistant to your DB2 server/database.

    Configure the ODBC as well

    Test it.

    Then create a new linked server with the MS OLDB Provider for ODBC driver where you select the previsiusly created ODBC setting.

    In the Security context tab select the "Be made using this security context" radiobutton and fill the remote login and remote password fields.

    That's it



    Bye
    Gabor

  • Thanks for your suggestions.  I am trying all the above.  But it will talke some time to work it all out.  I am having to work with the Network Admin.  Since this db is in the DMZ on a WEB server.  I will report back when I find my final sollution.

    Gabor, have you used the Client Configuration Assistant to hit a server in a DMZ?  Do you know of any gotchas?  It is resolving the IP but it appears we do not have a port open or something along that line.

    Thanks Again!

  • You have to open the port you are communicating.

    The very first task you have is the make your DB2 client working and accessing the server. Once it's done creating the linked server is a matter of seconds



    Bye
    Gabor

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply