× 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 Rick,

Thank you for the response! Now I am able to handle the CLASSPATH variable.

But still, if I compile a .java file on my pc (java version 1.6.0_07), move
the compiled .class file into the /QIBM/UserData/OS400/SQLLib/Function
folder on the server V5R4, and create an externanal stored procedure by
registering this class, it generates the same error as mention from my
previous post.

However, if I comple the same .java file on V5R4, there is no problem. The
java version on V5R4 is 1.4.

If I compare the size of the two .class files generated by my pc and V5R4,
the size is 6k (my pc) and 4k (v5r4) respectively.

I wonder if it is the java version problem.

My questions are:
(1) What is the highest java version that could be upgraded to for a V5R4
machine?
(2) If I have two version java jdk on my pc, say both 1.6 and 1.4, how do I
choose to use the 1.4 version to compile?


thanks,
yan

On Wed, Apr 8, 2009 at 8:52 AM, Rick DuVall <R_C_DUVALL@xxxxxxxxxx> wrote:

Hello Yan,

Prompt WrkEnvVar and select LEVEL(*SYS) and you will see a
display somewhat like the one from my production system below.
From there you can add or update your CLASSPATH and it does
indeed persist. Hope this helps...

Java rocks... ;)


Work with Environment Vars (*SYS)

Type options, press Enter.
1=Add 2=Change 4=Remove 5=Display details 6=Print

Opt Name Value

JWSDP_HOME '/QIBM/UserData/jwsdp-1.6'
JWSDP_LIBS '/QIBM/UserData/jwsdp-1.6/jwsdp-sha' >
JAXP_LIBS '/QIBM/UserData/jwsdp-1.6/jaxp/lib;' >
JAXR_HOME '/QIBM/UserData/jwsdp-1.6/jaxr'
JAXRPC_HOME '/QIBM/UserData/jwsdp-1.6/jaxrpc'
JAXB_HOME '/QIBM/UserData/jwsdp-1.6/jaxb'
ANT_HOME '/QIBM/UserData/jwsdp-1.6/apache-an' >
ANT_LIBS '/QIBM/UserData/jwsdp-1.6/apache-an' >
CLASSPATH '/QIBM/ProdData/OS400/jt400/lib/jt4' >
PATH '/usr/bin:/home/jakarta-tomcat-5.5.' >

More...


--
Best regards,
Rick DuVall
Systems Manager
Dealer's Auto Auction of Okc
1028 S. Portland
Oklahoma City, OK 73108
(405) 947-2886
mailto:rick@xxxxxxxxxx
http://www.nothingisreal.com/dfki/no-word


Tuesday, April 7, 2009, 3:07:12 PM, you wrote:

Background info
Server: V5R4
Using iSeries Navigator from my pc (os: vista)
The input parameters of the java method: 2 input parameters with
"BigDecimal" type, and a result set parameter: ResultSet[] rs; the method
will produce one result set

My source sode is as follows:

----------------------------------------------------------------------------
import java.math.BigDecimal;
import java.sql.*;

public class JavaReturnTable2_1pc {

public static void JavaSP1(
BigDecimal s1, BigDecimal s2, ResultSet[] rs )
throws SQLException, Exception {

Connection con =
DriverManager.getConnection("jdbc:default:connection");
PreparedStatement stmt = null;
String sql;
sql = "select tdate,tyear, tmon,tdsfm from gusd.dimtime where
tdate
between ? and ?";
stmt = con.prepareStatement(sql);
stmt.setBigDecimal(1, s1);
stmt.setBigDecimal(2, s2);

rs[0]= stmt.executeQuery();

}

}


--------------------------------------------------------------------------
If I (1) compile my .java file (1 single .java file and does not contain
a
main method) on my own pc, (2) move the generated .class file into
following
directory through iSeries Navigator (drag the .class in)
/QIBM/UserData/OS400/SQLLib/Function, (3) define an external java stored
procedure through iSeries navigator, (4) run this stored procedure; I get
following error message:

SQL State: 42724
Vendor Code: -4304
Message: [SQL4304] Java stored procedure or user-defined function
JAVARETURNT2_1PC, specific name JAVARETURNT2_1PC could not load Java
class
JavaReturnTable2_1pc for reason code 1. Cause . . . . . : The Java
class
given by the EXTERNAL NAME clause of a CREATE PROCEDURE or CREATE
FUNCTION
statement could not be loaded. The reason codes and their meanings
follow: 1
-- The class was not found on the CLASSPATH. 2 -- The class did not
implement the required interface ("com.ibm.db2.app.StoredProc" or
"com.ibm.db2.app.UDF") or lacked the Java "public" access flag. 3 -- The
default constructor failed or was unavailable. Recovery . . . : Ensure
that the compiled ".class" file is installed in the CLASSPATH, for
example
under "/QIBM/UserData/OS400/SQLLib/Function". Ensure it implements the
required Java interfaces and is "public".

---------------------------------------------------------------------------
However, if I (1) move the same .java file into
/QIBM/UserData/OS400/SQLLib/Function, (2) compile this .java file through
QSHELL, which generate the corresponding .class file, (3) the same as
above;
I get can the result I want.

---------------------------------------------------------------------------
In the green screen, I type in WRKENVVAR command, there is not a variable
with name "CLASSPATH" shown.

---------------------------------------------------------------------------
My questions:
1. I wonder why I got that error (The class was not found on the
CLASSPATH)
in the first situation?
2. When I compile my .java file on OS400, it works out well. What is the
defalt classpath it uses?
3. If I want to put my java code into some other user defined folders
instead of "/QIBM/UserData/OS400/SQLLib/Function", what should I do with
the
CLASSPATH variable?
4. I hope the "CLASSPATH" variable existing in the system permenently (it
means, when I log out and log in again, the variable is still there), how
do
I do it?


Thanks for taking your time answering my questions!

Yan

--
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-Ups:
Replies:

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.