Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Accessing DB2 database on IBM AS/400

465 views
Skip to first unread message

Thomas Ackermann

unread,
Sep 21, 1998, 3:00:00 AM9/21/98
to
Hi there!

Does anybody know, if there is a way to access a DB/2 database running on an
IBM AS/400 machine?

I am in search of a way to use a LINUX Webserver providing on-line services
over WWW using data from the IBM - of course i would like to use Python
for this ... ;-)

If there is a simply way to access DB/2 with Python from a LINUX machine, i
*can* use LINUX and Python ... otherwise i neeed to use Windows NT and
Lotus Notes (what seems to work) to get the data ;-(

Thanx for any help!
Byebye,
--
Thomas Ackermann | <t...@math.uni-bonn.de> | Tel. 0228/73-7773|631369
LINUX, not Micro$oft! | Use Python - look at www.python.org
no unnecessary Graphics in HTML-Document! | GURPS, not T$R!
put your HTML stuff in a ftp-accessible directory!
finger t...@rhein.iam.uni-bonn.de for public key

Tim Chase

unread,
Sep 22, 1998, 3:00:00 AM9/22/98
to Thomas Ackermann


> Does anybody know, if there is a way to access a DB/2 database running on an
> IBM AS/400 machine?
>

I use the Python on Win95 and the odbc module to access AS/400 databases
all the time. However, you need to have IBM Client Access (or Rumba I
suppose) on the client (which is the machine with Python). As far as I
know, this would cut out using Linux unless you wanted to use a Win95
machine as a gateway.

I can think of another way. If your AS/400 version is V3R7 or greater then
you should have IBM's AS/400 http server available. I am more familiar
with the AS/400 web server from I/NET, but I am pretty sure they have
similar features.

You could write some cgis on the AS/400 to process the database requests.
There should be a C/400 API for the web server and if you use SQL/400 to
retrieve the data, you don't have to mess with RPG. Then you could use
Python to retrieve data from the AS/400 http server.

Good Luck,

Tim Chase
First Assistant, Computer Services
The Public Library of Cincinnati and Hamilton County

Thomas Ackermann

unread,
Sep 22, 1998, 3:00:00 AM9/22/98
to
Tim Chase wrote:
> > Does anybody know, if there is a way to access a DB/2 database running on an
> > IBM AS/400 machine?
> >
> I use the Python on Win95 and the odbc module to access AS/400 databases
> all the time. However, you need to have IBM Client Access (or Rumba I
> suppose) on the client (which is the machine with Python). As far as I
> know, this would cut out using Linux unless you wanted to use a Win95
> machine as a gateway.

Hi Tim,
at first many thanks for your fast reply!

Christopher G. Petrilli wrote in an email about "mxODBC", and i got it from
"Freshmeat". I'm still unsure if i can use it to access the database
without something like "IBM Client Access" ;-/


> I can think of another way. If your AS/400 version is V3R7 or greater then
> you should have IBM's AS/400 http server available. I am more familiar
> with the AS/400 web server from I/NET, but I am pretty sure they have
> similar features.
>
> You could write some cgis on the AS/400 to process the database requests.
> There should be a C/400 API for the web server and if you use SQL/400 to
> retrieve the data, you don't have to mess with RPG. Then you could use
> Python to retrieve data from the AS/400 http server.

I'm hard trying to work with LINUX because that is my world ;-)
Only if there is no possible way, i will try and make myself familar with
the AS/400 ...

Thanx again and


Byebye,
--
Thomas Ackermann | <t...@math.uni-bonn.de> | Tel. 0228/73-7773|631369

GNU/LINUX, not Micro$oft! | Use Python - look at www.python.org
No unnecessary Graphics in WWW-Pages! | GURPS, not T$R!
finger t...@rhein.math.uni-bonn.de for public key

Joel Eikenhorst

unread,
Sep 25, 1998, 3:00:00 AM9/25/98
to
IBM provides a JDBC drive in a package called Java Toolbox for AS/400.
Check the website www.as400.ibm.com.


Carey Evans

unread,
Sep 26, 1998, 3:00:00 AM9/26/98
to
Tim Chase <ch...@iac.net> writes:

> I can think of another way. If your AS/400 version is V3R7 or greater then
> you should have IBM's AS/400 http server available. I am more familiar
> with the AS/400 web server from I/NET, but I am pretty sure they have
> similar features.
>
> You could write some cgis on the AS/400 to process the database requests.
> There should be a C/400 API for the web server and if you use SQL/400 to
> retrieve the data, you don't have to mess with RPG.

In fact, IBM supply something called Net.Data with all recent versions
of OS/400; see <URL:http://www.as400.ibm.com/netdata>.

After installing it properly, you could write a Net.Data program like
the following one, and access it using httplib with something like:

http://as400sys.bigcompany.com/cgi-bin/db2www/macro/test1?name=Joe

-----
%{ This code is untested. %}

%FUNCTION(DTW_SQL) qry() {
SELECT NAME, ADDR, PHONE FROM LIBRARY.FILE
WHERE NAME = '@DTW_rADDQUOTE(x)'
%}

%HTML(test1) {
<TITLE>Test 1</TITLE>
@qry()
}
-----

You can format the HTML with Net.Data and forward it back via the
Linux web server. Once you get more complicated, you might want to
intercept the data and actually do the useful bits in Python.

--
Carey Evans http://home.clear.net.nz/pages/c.evans/

"So, do you steal weapons from the Army often?"
"Well, we don't get cable, so we have to make our own fun."

rad...@my-dejanews.com

unread,
Sep 28, 1998, 3:00:00 AM9/28/98
to
In article <87u31vl...@psyche.evansnet>,
Carey Evans <c.e...@clear.net.nz> wrote:

> Tim Chase <ch...@iac.net> writes:
> In fact, IBM supply something called Net.Data with all recent versions
> of OS/400; see <URL:http://www.as400.ibm.com/netdata>.
>
> After installing it properly, you could write a Net.Data program like
> the following one, and access it using httplib with something like:
>
> http://as400sys.bigcompany.com/cgi-bin/db2www/macro/test1?name=Joe
>
> -----
> %{ This code is untested. %}
>
> %FUNCTION(DTW_SQL) qry() {
> SELECT NAME, ADDR, PHONE FROM LIBRARY.FILE
> WHERE NAME = '@DTW_rADDQUOTE(x)'
> %}
>
> %HTML(test1) {
> <TITLE>Test 1</TITLE>
> @qry()
> }
> -----
Alternatively you could use one of the "Client Access" ODBC drivers
to access the database directly. It all depends on what you want to
achieve and in what kind of environment.

Another kind of hack would be (if the machine is running TCP/IP)
connecting via FTP on a user account with access to 1 library in
which you would place your SQL script to be executed and then calling
the SQL engine (command line utility) via RCMD (FTP remote command)
to produce output back in the same library. You could then retrieve
the result per FTP and parse/present the results as needed.
(Seems like a lot of work,though 8-)

Mail me if you want more info
Cheers
Florent Heyworth

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

Andrew Robinson

unread,
Oct 5, 1998, 3:00:00 AM10/5/98
to
t...@rhein.iam.uni-bonn.de (Thomas Ackermann) wrote:

>Hi there!


>
>Does anybody know, if there is a way to access a DB/2 database running on an
>IBM AS/400 machine?
>

>I am in search of a way to use a LINUX Webserver providing on-line services
>over WWW using data from the IBM - of course i would like to use Python
>for this ... ;-)
>
>If there is a simply way to access DB/2 with Python from a LINUX machine, i
>*can* use LINUX and Python ... otherwise i neeed to use Windows NT and
>Lotus Notes (what seems to work) to get the data ;-(
>
> Thanx for any help!
> Byebye,

This is no help at all to you on Unix, but on Win32, Delphi AS400
provides a great way to connect. As well as using SQL, you can
directly call RPG programs and set and get parameter values, monitor
jobs, and do lots of funny tings with 'Q' in the name that I do not
understand yet. Since it is eas to write a Python extension in
Delphi, this may help someone else.

Shame about the four-figure price tag....

Andy
Andy Robinson
Robinson Analytics Ltd.


Carey Evans

unread,
Oct 7, 1998, 3:00:00 AM10/7/98
to
an...@robanal.demon.co.uk (Andrew Robinson) writes:

> This is no help at all to you on Unix, but on Win32, Delphi AS400
> provides a great way to connect.

On Win32, you can use COM quite effectively, if you have IBM's Client
Access. The actual connections are over normal TCP/IP sockets, so if
someone could find out if IBM have the specs available, it could
probably be done from Python on any platform.

Thomas Ackermann

unread,
Oct 8, 1998, 3:00:00 AM10/8/98
to
Thanx for all this information - it is still hard to decide which way
we should go ...
If DB2 for LINUX comes out indeed, we will use this method, i think.
Otherwise, if Net.Data is available, we will try this.
(Lot of dependency on IBM, it seems ;-(

Otherwise, we still could use JDBC (Intersolv) or JSQL (if available
for LINUX), but this is dependency again (on SUN) ... ;-(

I still can't believe how hard it is to get stuff for LINUX.

The last way seems to be using some hacked scripts to transfer
data-requests and database-replies. I'm unsure about how this could
work, but we willl see ;-)

Thanx anybody who tried to help!


Byebye,
--
Thomas Ackermann | <t...@math.uni-bonn.de> | Tel. 0228/73-7773|631369

LINUX, not Micro$oft! | Use Python - look at www.python.org

teg...@my-dejanews.com

unread,
Oct 10, 1998, 3:00:00 AM10/10/98
to
In article <6u5t69$s...@news.rhrz.uni-bonn.de>,

t...@rhein.iam.uni-bonn.de (Thomas Ackermann) wrote:
> Hi there!
>
> Does anybody know, if there is a way to access a DB/2 database running on an
> IBM AS/400 machine?
>
> I am in search of a way to use a LINUX Webserver providing on-line services
> over WWW using data from the IBM - of course i would like to use Python
> for this ... ;-)
>
> If there is a simply way to access DB/2 with Python from a LINUX machine, i
> *can* use LINUX and Python ... otherwise i neeed to use Windows NT and
> Lotus Notes (what seems to work) to get the data ;-(
>
> Thanx for any help!
> Byebye,
> --

You can you java & jdbc to access data from the AS/400. Look for AS/400
Toolbox for Java in the ibm site.

Bye!

mike...@my-dejanews.com

unread,
Oct 27, 1998, 3:00:00 AM10/27/98
to
I use IBM's client access to get to the AS400. This comes with an ODBC
driver. I did performance tests with CO400 and I find ODBC was more than
twice as fast as CO400. I also use the ODBC with Access 97 to read and,
horrors, write data to the AS/400.


In article <874sthq...@psyche.evansnet>,


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

0 new messages