Accessing DB2 with Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shawn Milo

    #1

    Accessing DB2 with Python

    Is anyone doing this? I would like to access a DB2 database (IBM's database)
    with Python. I checked "Python in a Nutshell," and it refers to
    ftp://people.linuxkorea.co.kr/pub/db2, but I am unable to connect
    to that site, although it could be a firewall issue, as I am at work.

    Is there any commonly used module for this?

    Thanks,
    Shawn
  • Larry Bates

    #2
    Re: Accessing DB2 with Python

    I just tried the link at it works from here. Site has
    source and Windows binary versions of software. Looks
    loke it is being maintained. Windows binary for Python
    2.3 was added in September 2004. No 2.4 binary.

    Larry Bates
    Syscon, Inc.

    Shawn Milo wrote:[color=blue]
    > Is anyone doing this? I would like to access a DB2 database (IBM's database)
    > with Python. I checked "Python in a Nutshell," and it refers to
    > ftp://people.linuxkorea.co.kr/pub/db2, but I am unable to connect
    > to that site, although it could be a firewall issue, as I am at work.
    >
    > Is there any commonly used module for this?
    >
    > Thanks,
    > Shawn[/color]

    Comment

    • Jean Brouwers

      #3
      Re: Accessing DB2 with Python



      Try <ftp://people.linuxkor ea.co.kr/pub/DB2> with capital DB.

      /Jean Brouwers


      In article <mailman.7878.1 103221440.5135. python-list@python.org >, Shawn
      Milo <ShawnMilo@runb ox.com> wrote:
      [color=blue]
      > ftp://people.linuxkorea.co.kr/pub/db2,[/color]

      Comment

      • Jan Dries

        #4
        Re: Accessing DB2 with Python

        Shawn Milo wrote:[color=blue]
        > Is anyone doing this? I would like to access a DB2 database (IBM's
        > database)
        > with Python. I checked "Python in a Nutshell," and it refers to
        > ftp://people.linuxkorea.co.kr/pub/db2, but I am unable to connect to
        > that site, although it could be a firewall issue, as I am at work.
        >
        > Is there any commonly used module for this?[/color]

        You could try mxODBC. It has support for DB2. You can find it at:
        mxODBC&trade; is the eGenix flagship product for connecting Python to all major databases, on all major platforms, using a fully Python DB-API 2.0 standard compatible ODBC interface, with many extensions and enhanced support of stored procedures with input, output and input/output parameters.

        You can download it for free and use it for a 30 day evaluation period.
        After that, you must pay for a commercial license.

        Regards,
        Jan

        Comment

        • Jarek Zgoda

          #5
          Re: Accessing DB2 with Python

          Larry Bates wrote:
          [color=blue]
          > I just tried the link at it works from here. Site has
          > source and Windows binary versions of software. Looks
          > loke it is being maintained. Windows binary for Python
          > 2.3 was added in September 2004. No 2.4 binary.[/color]

          Be aware, that it's a module for "normal" DB2, not a DB2/400. To access
          DB2/400 you have to use ClientAccess ODBC (from Windows or *nix
          platform) driver or iSeries port of Python (from AS/400).

          --
          Jarek Zgoda
          http://jpa.berlios.de/ | http://www.zgodowie.org/

          Comment

          • Michel Claveau - abstraction méta-galactique non t

            #6
            Re: Accessing DB2 with Python

            Hi !

            it's not a web site, it's FTP...



            Comment

            • Grumman

              #7
              Re: Accessing DB2 with Python

              Jarek Zgoda wrote:[color=blue]
              > Be aware, that it's a module for "normal" DB2, not a DB2/400. To access
              > DB2/400 you have to use ClientAccess ODBC (from Windows or *nix
              > platform) driver or iSeries port of Python (from AS/400).
              >[/color]


              And just to be complete, under windows, using win32all, you can also use
              the OLE DB driver supplied with ClientAccess (IBMDA400), which offers
              some improvements over plain ODBC.

              Its been a long time since I did this, but it was *very* simple. I
              could probably dig up an example or two if necessary.

              Connection string basically looks like:
              Provider=IBMDA4 00;User ID=USERNAME;Pas sword=PASSWORD; Initial
              Catalog=DATABAS E_NAME;Data
              Source=AS_400_S ERVER_NAME

              Provider,User ID, Password, and Data Source are required. Data Source
              can be either an IP address, or a DNS defined hostname. I've never
              bothered with 'Initial Catalog', but it would be one of the database
              names visible via WRKDBR. (Usually defaults to the default system name,
              which is shipped set to the system serial#)

              Optionally, you can add 'Catalog Library List=Lib1 Lib2 Lib3' to add
              additional libraries to the current library list for the connection.

              Last I knew, there were a few methods exposed by ADO that weren't
              supported via this driver, but like I said, its been a long time.

              I'm sure there's a pretty complete python ADO wrapper out there as well.

              Comment

              • Simon Brunning

                #8
                Re: Accessing DB2 with Python

                On Thu, 16 Dec 2004 20:20:09 -0500, Grumman <grumman@exampl e.com> wrote:[color=blue]
                > I'm sure there's a pretty complete python ADO wrapper out there as well.[/color]



                --
                Cheers,
                Simon B,
                simon@brunningo nline.net,

                Comment

                Working...