473,587 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5358
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.linuxkor ea.co.kr/pub/DB2> with capital DB.

/Jean Brouwers
In article <ma************ *************** ***********@pyt hon.org>, Shawn
Milo <Sh*******@runb ox.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=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.
Jul 18 '05 #7
On Thu, 16 Dec 2004 20:20:09 -0500, Grumman <gr*****@exampl e.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***@brunningo nline.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
10271
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 I am not on Linux and this is mainly for a Windows platform. Can anyone shed some light? Thanks,
4
4196
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. Does anybody have any good pointers on where I can find information about accessing Word-documents (or other Microsoft Office applications) from Python? To be more specific, I want to be able to: - get the text content of the full Word document
0
1232
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 frequently, but I've run into a few situations recently where it would be really useful from a debugging standpoint. You can get at a cell object containing a given value by making a quick closure and looking at the func_closure attribute: (lambda...
13
14717
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
3880
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 "<stdin>", line 1, in ? File "<stdin>", line 2, in foo
0
1497
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 name 'Alexandria.' I tried to keep this simple by putting a soap message in a string and sending the request using httplib. I am receiving the following error message.
0
1032
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 trying to automate this task using Python: 1) Get the Application Name 2) Access the Add/Remove Program details and check if the application is present.
3
2103
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 something i would prefer to do in fortran (which i have never used, but will learn), but i have no experience of accessing non-python code from python. i am also fairly new to programming period, and am therefore tackling a fairly serious issue reletive...
2
1254
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, which I already know how to do. I am running Windows XP, Python 2.4. Thanks a lot!
10
1597
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 this in a faster way. The reason I'd like to do this is because I need to access the attribute inside a loop within some C code, and I find that the
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.