[Zope-DB] zope and as400

Jim Penny jpenny@universal-fasteners.com
Fri, 24 May 2002 11:21:17 -0400


On Fri, May 24, 2002 at 04:39:05PM +0200, Christian K. wrote:
> hello
> 
> do you know a way to contact zope with the as400 db2 database

nothing that I know of is easy or secure.  DB/2 on the AS/400 will
support both ODBC and JDBC.  The ODBC support seems to be slow, 
my timing (unixodbc on linux with IBM drivers, IBM's JDBC drivers)
showed that JDBC finished the tests I did in about 25% of the time of
ODBC.

So I concentrated on JDBC.  Here you have two major options -- there
was the beginning of a jdbc DA written.  I did not get it to work,
and had other things that were more urgent at the time.

So the easiest thing I could find was to take the example in IBM's JDBC
FAQ and turn it into a threaded server.  I connect this to zope by
using an external method that builds a SQL statement, forks a netcat to
push it to the JDBC threaded server and catch the answer(s).

Performance is mediocre, at best, but if you are doing a few short
queries to the AS/400, can be adequate.

You can get far better performance by using a prepared statement pool.
My tests show that in the presence of many repeated queries, you can
get another 4-fold improvement.  Unfortunately, this code is horrible,
and has a problem if a statement is used too many times.

Ordinarily, I have no trouble with sharing code.  In this case, my code
is simply too bad.

If you have the time and java expertise to write a proper threaded
server that supports prepared statements, I would be glad to help you
out in any way I can, coding, testing, or documenting.  As using
prepared statements well appears to be crucial to getting good
performance using this approach, writing a DA might be a challenge
(the DA would have to cache recent statements and have some kind of
cache flush policy to close the prepared statements.)

Hope this helps with ideas at least.

Jim Penny

> 
> best regards
> christian
> ________________________________________________________________
> Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! 
> Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13
> 
> 
> 
> 
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://lists.zope.org/mailman/listinfo/zope-db
>