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



Am I wrong about this. but if you are going to call the jar or class file,
don't you need a procedure called main to start the execution?


Michael Schutte
Admin Professional
Bob Evans Farms, Inc.
We've built a better hotcake -- Stacked and Stuffed Hotcakes -- coming
January 11th!

For hotcake tips, interviews with our chefs and more, check out the Stacked
and Stuffed blog at http://imstuffed.blogspot.com


java400-l-bounces@xxxxxxxxxxxx wrote on 02/14/2007 03:53:58 PM:

Thanks for input John.
I've been through most of what you have listed, still a couple things to
check, but I thought for the sake of it, I would go ahead and post my
code.  Don't laugh at the code, as I'm really just getting my feet wet
with java.
package lockBox;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class ConnectDB2 {

   public static Connection connect()
   {
      Connection connection=null;
      String driver = "com.ibm.as400.access.AS400JDBCDriver";
      String url = "jdbc:as400:192.168.1.50;libraries=TSTMIS";

      try
      { // load the driver
        Class.forName(driver).newInstance();

      }
      catch( Exception e )
      { // problem loading driver, class not exist?
        e.printStackTrace();

      }
      try
      {
        connection = DriverManager.getConnection(url,
"remotecmd", "remote123");
        System.out.println("Connection to ISERIES
successful!");

      }
      catch( SQLException e )
      {
        e.printStackTrace();
      }
      return connection;
   }

}



*************************************************
package lockBox;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.io.*;

public class UploadLockBox {
   //public FaciltyAccessGetFiles() {
   //   super();
   //}

   public static Connection condb = null;

   public static Statement stmtdb = null;

   public static void main(String[] args) {
      //
      try {

         condb = ConnectDB2.connect();
         try {

            BufferedReader in = new
BufferedReader(new FileReader(

"\\\\rgc-ad\\Public\\customer service\\lockbox\\lockbox payment
datafiles\\020707P.txt"));

            String str;
            while ((str = in.readLine()) != null) {
               names(str);
            }
            in.close();
         } catch (IOException e) {
         }

      } catch (Exception e) {
         e.printStackTrace();
         System.out.println(e.getLocalizedMessage());
         System.out.println("SQL Exception");

      }

      finally {
         if (condb != null) {
            try {
               condb.close();
            } catch (SQLException e) {
               e.printStackTrace();
            }
            System.exit(0);
         }
      }

   }

   /*********************************************************
    *
    *
    ********************************************************/
   public static void names(String str) {//B1
      //   the Statement object is what sends your SQL
statement to the DBMS
      // Read the Names file and populate USRMAPINI

      try {
         stmtdb = condb.createStatement();
         //if (!(str.equalsIgnoreCase("")))
         //{
         String query2 = "INSERT into tstmis.PFRPMFLAT "
+ "VALUES (" + "'" + str
               + "'" + ")";

         stmtdb.execute(query2);
         //}

      }//B1
      catch (SQLException f) {
         System.out.println("Invalid PFRPMFLAT
statement");
      }

      //more = false;
   }
   /****************************************/

}

Michael Smith
iSeries.mySeries.


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Herbert, John M
Sent: Wednesday, February 14, 2007 3:36 PM
To: java400-l@xxxxxxxxxxxx
Subject: RE: RUNJVA problems


Hi Mike,

Thought I would put my 2 cents worth in.  Below I have included an
example of the Java command running on our iSeries, V5R3, Java 1.4.  It
may give some clues as to where you are going wrong.... (RUNJVA is set
up similarly):


JAVA CLASS('com.xxxx.pdfgen.SplfMonitor')
CLASSPATH('/com/xxxx/as400splf2pdf/as4
00splf2pdf.jar:COM/xxxx/as400splf2pdf/XXXX_COMMON.JAR:/COM/xxxx/as400spl
f2pdf/LO
G4J-1.2.8.JAR:/COM/xxxx/as400splf2pdf/MSBBarCode.jar:/QIBM/ProdData/OS40
0/jt400/
lib/jt400native.jar:/com/StyleReportPro/xtools.jar:/com/StyleReportPro/x
report_p
ro.jar:/com/StyleReportPro/design_pro.jar') OPTIMIZE(40)
PROP((java.version 1.4)  (java.awt.headless true)) OPTION(*VERBOSE)
JOB(*GEN)

Points to note:
(1) In this case I am using the Native jt400native.jar.  I am not
suggesting going this way, but it is an alternative.
(2) I checked my IFS and our jt400.jar resides in this location:
/com/ProdData/HTTP/Public/jt400/lib/jt400.jar.  This version does have
AS400JDBCDriver.class included.  You may want to verify that in your
version.
(3) Note that the Class of your program called needs to have the fully
qualified name of the package to the Class being called.
(4) Note that any supporting jars need to be included in the classpath,
not just the folder that the jar resides.
(5) I recommend option(*verbose) while working out this issue.  It will
show you in the associated QPRINT every class that is being loaded, and
from where.
(6) You may want to verify with your admin that Java 1.4 is loaded on
the AS400.  I think it normally is with V5R3, but it may be an option
that needs to be added.  This can be checked with GO LICPGM, option 10.
You should see: 5722JV1   *COMPATIBLE  Java Developer Kit 1.4
(7) Verify that the jt400.jar that you are picking up is the only one in
your classpath, and that the version being used has the AS400JDBCDriver
included.
(8) Note: Running HelloWorld does not test jt400.jar capability as it
has no database connectivity.
(9) Finally, you may want to verify with your admin that no particular
access restrictions have been placed on the jt400.jar file i.e. you
should have read access.  If you have sufficient privilage, you can
check this with the WRKLNK command (just navigate to the jt400.jar and
use option 9 to work with authority).  You should have *PUBLIC *RX for
each level to the jt400.jar and on the jar.

Failing all that, then we will need to see how your program loads
AS400JDBCDriver.  Perhaps it is using an explicit path or something like
that.

Regards
John


date: Wed, 14 Feb 2007 10:49:25 -0500
from: "Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx>
subject: RE: RUNJVA problems

Don't take this the wrong way, but I feel better that you and Pete are
stumped on this.

Any way I have tried your last 2 suggestions with the same results.

I appreciate all the help, because  I just don't have a clue whats going
on.

Michael Smith
iSeries.mySeries.


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