473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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
Jul 18 '05 #1
7 5349
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:
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

Jul 18 '05 #2


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

/Jean Brouwers
In article <ma**************************************@python.o rg>, Shawn
Milo <Sh*******@runbox.com> wrote:
ftp://people.linuxkorea.co.kr/pub/db2,

Jul 18 '05 #3
Shawn Milo wrote:
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?


You could try mxODBC. It has support for DB2. You can find it at:
http://www.egenix.com/files/python/mxODBC.html
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

Jul 18 '05 #4
Larry Bates wrote:
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.


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/
Jul 18 '05 #5
Hi !

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

Jul 18 '05 #6
Jarek Zgoda wrote:
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).

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=IBMDA400;User ID=USERNAME;Password=PASSWORD;Initial
Catalog=DATABASE_NAME;Data
Source=AS_400_SERVER_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.
Jul 18 '05 #7
On Thu, 16 Dec 2004 20:20:09 -0500, Grumman <gr*****@example.com> wrote:
I'm sure there's a pretty complete python ADO wrapper out there as well.


http://adodbapi.sourceforge.net/

--
Cheers,
Simon B,
si***@brunningonline.net,
http://www.brunningonline.net/simon/blog/
Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Fazer | last post by:
Hello, I have a MP3 and I want to access the songs in them. I was wondering if Python could help me do that. I understand that this can be done using Linux by mountig it as a file system, but...
4
by: Mickel Grönroos | last post by:
Hi! I'm fiddling with Python for Windows (normally using Linux) and as a part of that I want to try to make a simple word frequency list generator to be used in conjunction with Microsoft Word....
0
by: paul cannon | last post by:
Having poked around a little bit, I found there doesn't appear to be any way to get at the contents of a cell object from Python. It's not the sort of thing that one needs to be doing very...
13
by: Joseph Garvin | last post by:
When I first came to Python I did a lot of C style loops like this: for i in range(len(myarray)): print myarray Obviously the more pythonic way is: for i in my array: print i
14
by: James Thiele | last post by:
I'd like to access the name of a function from inside the function. My first idea didn't work. >>> def foo(): .... print func_name .... >>> foo() Traceback (most recent call last): File...
0
by: Doug Caldwell | last post by:
Hi! ** Accessing the USGS Web Service Using Python ** I am trying to access the US Geological Survey's gazetteer SOAP web service using Python to find the locations of all the places with the...
0
by: Phoe6 | last post by:
Hi all, I have to uninstall an application and I don't find the uninstaller, the option available to me is to access Add/Remove Programs, select the application and remove from there. I am...
3
by: sam | last post by:
hello all, i am currently in the process of planning a piece of software to model polymerisation kinetics, and intend to use python for all the high-level stuff. the number-crunching is...
2
by: kyosohma | last post by:
Hi All, I need to access a Microsoft SQL database View. Is there a way to do this with Python? I have done a fair share of "googling" and found nothing on accessing Views, just executing SQL,...
10
by: Chris | last post by:
Hi, I'd like to be able to access an attribute of a particular Python object as fast as possible from some C code. I wondered if using __slots__ to store the attribute would allow me to do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.