× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Mike,
put your java classes on the iSeries IFS and call java from a clp. 
This will work fine as long as the iSeries has a tcp/ip connection to the 
windows server. You will have to change the iSeries jdbc java connection to 
user= *CURRENT and password=*CURRENT.
And I do not think this works in a clp: 
CLASSPATH('\\rgc-access\winsx$\IseriesJava\') 
Here is an example how to call java from a clp:
 PGM PARM(&XMLFILE &XSL &OUTFILE) 

 DCL VAR(&XMLFILE) TYPE(*CHAR) LEN(96) 
 DCL VAR(&XSL) TYPE(*CHAR) LEN(96) 
 DCL VAR(&OUTFILE) TYPE(*CHAR) LEN(96) 
 DCL VAR(&JAVA) TYPE(*CHAR) LEN(5000) 
 CHGCURDIR DIR('/XALAN') 
 JAVA CLASS(org.apache.xalan.xslt.Process) + 
 PARM('-IN' &XMLFILE '-XSL' &XSL '-OUT' &OUTFILE) + 
 CLASSPATH('.:/xalan/xalan.jar') OPTIMIZE(40) PROP((java.version 1.4)) 
 ENDPGM 
Best regards
Magne





-----Original Message-----
From: Smith, Mike [mailto:Mike_Smith@xxxxxxxxxxxxxxxx]
Sent: Tuesday, September 26, 2006 01:50 PM
To: 'Java Programming on and around the iSeries / AS400'
Subject: RE: Running java on Iseries

Joe
Let me see if I can explain without rambling too much. 
First let me start with what I'm doing and why- keeping in mind I'm
basically an RPG guy- who took a Java class a couple of years ago and
haven't had the need/opportunity to use it until now. 

We had a network admin who left recently that apparently had some
reports written in KIX(a scripting language)-or else they were created
manually. We just don't know. Anyway these reports are needed for Sox
auditing purposes and they don't seem to exist anymore. One of these
reports(the report in question) is created over a vendor package that
identifies employees and what buildings and hours of access. This data
is stored in an ACCESS database on a windows server. 

I have been tasked with recreating the reports. The first report I was
able to create by tapping into the LDAP server via RPG and creating the
report. The above report I have been able to create using a combination
of Java and RPG. These reports need to be run on the same frequency. 

This java program has 2 ODBC connections. 1 to the ACCESS database
using.
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String url = "jdbc:odbc:AcsData"; 

The connection to the Iseries is 
String driver = "com.ibm.as400.access.AS400JDBCDriver";

As I read the records I write them to an file on the Iseries. 

I could probably just write the report using Java also, but for now I'd
like to pursue my current path. Baby steps you know. 


So that brings me to my current problem. As you and others have pointed
out, that since I'm using ACCESS it is not practical to have my Java
program on the ISERIES. 

What I have done is from WDSC Export on my Package to the Windows server
that contains this ACCESS database. 

Ideally I would like to be able to call it from within a CL. That's why
I was trying the RUNJVA command- but maybe that's now how it should be
done. 

Anyway here is the pertinent information. 

Package: FAC
Java: FacilityAccessGetFiles.class
Location: \\rgc-access\winsx$\IseriesJava

I hope this explains what I'm trying to accomplish and thanks to all who
have helped. 

Michael Smith
iSeries.mySeries.


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Joe Pluta
Sent: Monday, September 25, 2006 3:52 PM
To: 'Java Programming on and around the iSeries / AS400'
Subject: RE: Running java on Iseries


Hi Mike!

Sorry I didn't respond sooner; it's been a busy ... um ... year, to be
honest <grin>.

Anyway, let me ask a silly question to get my bearings here. How do you
plan to access the database? Are you using the standard ODBC driver?
If so, that means the Java program must run on a Windows machine, since
there is no ODBC provider for the iSeries.

Because that's a big issue. If you try to run the Java program from the
iSeries, it just won't access the Access database (sorry to be
redundant). The Java program must run on a machine that has the
appropriate ODBC driver.

Okay, next silly question. What do you plan to do with the data? That
is, why are you running this program on the iSeries at all? Are you
accessing the iSeries database or calling an iSeries program? If so,
are you using the IBM Toolbox? If that's the case, then you probably
should be running the program on the Windows box, because you can use
the Windows ODBC driver to access the data, but the IBM Toolbox is smart
enough to allow you to call programs on an iSeries even if the program
isn't running on another machine!

So maybe a little more clarification on what you're trying to do before
we travel much farther down the path of where you're storing your class
files (because if you are running on the iSeries, it will be much easier
to run from the IFS, not from a network drive).

Joe


From: Smith, Mike

I've finally gotten back to this and am trying to get it to run.

I have placed the program on the server where the Access database 
resides.

My package is named FAC
My java program is called FacilityAccessGetFiles
The location is \\rgc-access\winsx$\IseriesJava

I would like to do 2 things. It might be redundant. If it doesn't 
make sense tell me.

First,
I want to go to this directory and try to run it directly. If I right

click on the FacilityAccessGetFiles, I don't see the ability to run 
this program. How would I do this?

Secondly I want to call from CL.
I tried using the information below, but I haven't been able to get it

to run. I get Class not found. Using the following
===> RUNJVA CLASS('mike\FacilityAccessGetFiles')
CLASSPATH('\\rgc-access\winsx$\IseriesJava\')

Can you set me straight on this?


-- 
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,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.


-- 
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,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.