Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Informix 4GL call JAVA Program 1

Status
Not open for further replies.

ttkong

Programmer
Jun 5, 2002
22
MY
Hi all,

We do know that how to create 4GL runner using C program so that C function can be called by 4GL program to perform low level routine such as reading a file and pass in row of the file to 4GL for futher process.

Can we replace C program with JAVA? In another word, can we build runner using JAVA to perform the same?

If negative, is there anyway for 4GL program to call JAVA function to read a file contents, and return the file contents to 4GL program?

Thanks.

Rgrds,
ttkong

 
I'm almost sure you cannot.

What you can do is:
- call an external program that runs a Java program
- this java program generates a file
- you then load the file into 4gl
- you can then do what you want


Imagine we have a java program called 'my_prog.java'. This program writes data I need in a file called javaout.dmp.

...
# Build a command line
let cmdbuf = "java my_prog.java"
# Execute command line
run cmdbuf

# At this step, I have my file

# Create a temp table to hold data
create temp table rawdata ( char(a_lot) );
# Load data
load from "javaout.dmp" insert into rawdata;

# Go through data
declare c1 cursor for select * from rawdata
foreach c1 into rawbuffer
# Do stuff
end foreach
...

I hope this helps.
I did something like that with Perl.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top