Here's an approach I saw at a customer recently...

Journal the database files, before and after images. Then create a exit
program for RCVJRNE that generates the INSERT, UPDATE and DELETE

This particular customer logged the SQL statements with date/time stamps
into a physical file. Then another ODBC or JDBC retrieval was used to
execute the statements on the external database.


Ken Slaugh (707) 795-1512 x118 
Chouinard & Myhre, Inc. 


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Glenn Holmer
Sent: Wednesday, October 05, 2005 9:31 AM
To: java400-l@xxxxxxxxxxxx
Subject: trigger or listener?

We want to have a Postgres database on a Linux web server updated when
the corresponding record on the AS/400 changes.  We are thinking:

a) DB trigger on the '400 that wakes up when the record is changed and
calls a Java program (also on the '400), passing the needed parameters
as arguments to main(); the Java program uses JDBC to update the
Postgres database on the Linux server.  Pro: probably easy to set up,
Con: new process spawned for each write.

b) A Java program that runs all the time and listens for changes on the
AS/400 database using something like FileListener from the JT400 toolbox
(haven't researched this yet); he would do the same as a).  
Pro: single program, Con: don't know if it's possible.

What recommendations would you guys make?  We are hoping to get away
without modifying the program that is actually making the changes on the
'400.  We are not talking about a huge number of records here; probably
a couple hundred every few hours.

Glenn Holmer                          gholmer@xxxxxxxxxxxxxx
Software Engineer                        phone: 414-908-1809
Weyco Group, Inc.                          fax: 414-908-1601
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at

This thread ...

Return to Archive home page | Return to MIDRANGE.COM home page