× 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.



Java *VERSION returns Version JVM V5R1M0 JDK 1.4.2.

Yes, I verified in LICPGM that 5722JV1 optino 4 is no longer installed.

Whether I call it via JDBC from another machine or JDBC using *LOCALHOST, 
I get the same results.  Here is the source:


CREATE PROCEDURE SSLIB.TEST(INOUT prm1 VARCHAR(4096)) 
                 LANGUAGE JAVA
                 PARAMETER STYLE JAVA
                 NOT FENCED
                 EXTERNAL NAME 'ssi.SSIAPI.test';
package ssi;

public class SSIAPI {
 
                 public static void test(String[] result) throws Exception 
{
                                 StringBuffer b = new StringBuffer();
 b.append(System.getProperty("java.version")).append('\n');
 b.append(System.getProperty("java.class.path")).append('\n');
                                 result[0] = new String(b);
                 }
 
                 public static void main(String[] args) {
                                 String[] sa = new String[] {"aaa"};
                                 try {
                                                 test(sa);
                                 }
                                 catch (Exception ex) {
                                                 ex.printStackTrace();
                                 }
                                 System.out.println(sa[0]);
 
                 }
 
}

package ssi;

import java.sql.CallableStatement;
import java.sql.DriverManager;
import java.sql.Types;
import com.ibm.as400.access.AS400JDBCConnection;
import com.ibm.as400.access.AS400JDBCDriver;

public class Test {
 
                 public static void main(String[] args) {
                                 test1();
                 }
 
                 public static void test1() {
                                 System.out.println("Hello Scott. Here is 
the same program with debug");
                                 System.out.println("Entering function. 
Here I print version of JVM this program runs");
 System.out.println(System.getProperty("java.version"));
                                 AS400JDBCConnection connection = null;
                                 try {
                                                 new AS400JDBCDriver();
                                                 System.out.print("Now 
connectiong to local host over JDBC... ");
                                                 connection = 
(AS400JDBCConnection)DriverManager.getConnection("jdbc:as400://localhost");
 System.out.println("Connected");
                                                 System.out.print("Now 
preparing to call SSLIB.TEST... ");
                                                 CallableStatement stmt = 
connection.prepareCall(
                                                                 "call 
SSLIB.TEST(?)"
                                                 );
 stmt.registerOutParameter(1, Types.CHAR);
                                                 stmt.setString(1, "aaa");
 System.out.println("Prepared");
                                                 System.out.print("Now 
executing SSLIB.TEST... " +
  "It'll make host server to create another JVM to execute ssiSSIAPI... 
");
                                                 stmt.execute();
 System.out.println("Done");
                                                 System.out.println("Here 
is the version of second JVM");
 System.out.println(stmt.getString(1));
                                                 System.out.print("Now 
closing all resources... ");
                                                 stmt.close();
 System.out.println("Done");
                                 }
                                 catch (Exception e) {
                                                 e.printStackTrace();
                                 }
                                 finally {
                                                 if (connection != null) 
try {connection.close();} catch (Exception ex) {}
                                                 System.exit(0);
                                 }
                 }
 
}


Thanks!

Scott



Bruce Jin <brucej@xxxxxxxxxxxxxxxxxxxx> 
Sent by: java400-l-bounces@xxxxxxxxxxxx
08/03/2006 07:53 AM
Please respond to
Java Programming on and around the iSeries / AS400 
<java400-l@xxxxxxxxxxxx>


To
Java Programming on and around the iSeries / AS400 
<java400-l@xxxxxxxxxxxx>
cc

Subject
Re: Java Stored Procedures






What  does “java *version” return? (or “java -version” in qshell).

You removed JDK 1.2. Can you verify it using “GO LICPGM” option 10?

What is “remotely called stored procedure”? is the code running remotely 
on another box?

Thanks.

 



Scott Jordan wrote:
Sorry!

I didn't mean to be so terse.  I'm using the following to retrieve the 
JDK 
version:
System.out.println(System.getProperty("java.version"));

Thanks for any help!

Scott



Bruce Jin <brucej@xxxxxxxxxxxxxxxxxxxx> 
Sent by: java400-l-bounces@xxxxxxxxxxxx
08/02/2006 09:50 AM
Please respond to
Java Programming on and around the iSeries / AS400 
<java400-l@xxxxxxxxxxxx>


To
Java Programming on and around the iSeries / AS400 
<java400-l@xxxxxxxxxxxx>
cc

Subject
Re: Java Stored Procedures






How do you know you are getting JDK 1.2 from a remotely called stored 
Procedure?


Scott Jordan wrote:

Hello!

We are writing Java Stored Procedures on V5R1.  Our Java.Version always 

returns 1.2.  However, when we run the same procedure interactively, we 

get JDK 1.4.  We've tried messing with the SystemDefault.properties 
both 



for the system and in the user's directory, as well as QUSER, and even 
QSYS!

We removed JDK 1.2.  We still get JDK 1.2 from a remotely called stored 

procedure.

Has anyone else experienced this?

Thanks!

Scott






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.