On Wed, Jun 22, 2016 at 5:54 PM, Jim Steil <jim@xxxxxxxxxxxxxxx> wrote:
Hey John - where can I get some info on ibm_db? I tried out the itoolkit
on my IBM i today and was a bit disappointed in what I had to do to access
the database. I'm guessing this is not going to be the preferred method of
db access for Python. I'd appreciate pointers to any info you have on
ibm_db for Python...
I agree with Kevin: Under normal circumstances, you should not be
using ibm_db directly, but rather ibm_db_dbi, to get the standard
Python database interface as laid out in PEP 249. If you're a
long-time Python user, you're probably already familiar with this
interface. If not, I find the PEP is pretty good documentation for it.
To be completely honest, I have never had especially high hopes for
itoolkit, whether for accessing data or programs:
http://yips.idevcloud.com/wiki/index.php/XMLSERVICE/Python
The documentation for the underlying XMLSERVICE has been around for
quite some time now, as well as some of its wrappers in other
languages. It just seems fundamentally verbose and cumbersome, by
Python standards. The Python version (judging by the documentation
linked to above) is about as verbose as I was expecting. It looks
almost as bulky as Java, but with a style reminiscent of Ruby. Or
maybe JavaScript. (I only have a passing familiarity with those
languages.) But I haven't given it a fair shake yet, so we'll see.
If I do become a convert to IBM's Python (as opposed to the
third-party iSeriesPython which I'm using now), I may wind up writing
my own wrapper for itoolkit, or my own fork of itoolkit.
To me, itoolkit seems to be mainly for calling native programs and
service programs (mostly written by your own shop, mostly in RPG), or
IBM system APIs. Both of these uses are probably dwindling niches, as
more and more people write stored procedures and UDFs, and IBM exposes
more and more system services to SQL. Eventually, you may be able to
just do everything with ibm_db_dbi. But I know our shop is far from
that point.
John Y.
As an Amazon Associate we earn from qualifying purchases.