|
I'm trying to run this program which returns the job number from the
AS400. I can run it from visual age but how do I set the class path to run
it from my PC?
To run it I change the directory to: C:\JAVA GROUP\as400>
Then I enter: java class(AS400SP) classpath('c:\java group\as400')
And get the message:
Can't find class class(AS400SP) or something it requires
Here is the code:
package as400;
/**
* Insert the type's description here.
* Creation date: (4/9/01 12:56:02 PM)
* @author: Administrator
*/
import java.sql.*;
import java.math.*;
import com.ibm.as400.access.*;
public class AS400SP {
AS400SP () {
Connection con = null;
long c = 0;
try {
Class.forName("com.ibm.as400.access.AS400JDBCDriver");
} catch( ClassNotFoundException e) {
System.out.println("JDBC Driver not found: " + e);
}
try {
// load the jdbc driver
// DriverManager.registerDriver(new
com.ibm.as400.access.AS400JDBCDriver())
con = DriverManager.getConnection ("jdbc:as400:hb2000;");
long timer1=System.currentTimeMillis();
Statement stmt = con.createStatement();
stmt.executeUpdate("CALL QSYS.QCMDEXC('QSYS/DSPJOBLOG
OUTPUT(*OUTFILE) OUTFILE(QTEMP/QAUGDBJOBN) OUTMBR(*FIRST
*REPLACE)',0000000081.00000)");
System.out.println("Procedure Executed");
ResultSet rs = stmt.executeQuery ("SELECT
SUBSTRING(QMHJOB,1,10) AS JOBNAME,SUBSTRING(QMHJOB,11,10) AS
USERNAME,SUBSTRING(QMHJOB,21,6) AS JOBNUM FROM QTEMP.QAUGDBJOBN WHERE
QMHMID = 'CPIAD02'");
rs.next();
System.out.println(rs.getString("JOBNAME")) ;
System.out.println(rs.getString("USERNAME")) ;
System.out.println(rs.getString("JOBNUM")) ;
System.out.println("End Test");
} catch (SQLException e) {
System.out.println("SQL error : " + e);
return;
}
}
public static void main (String[] pList) {
new AS400SP();
System.exit(0);
}
}
+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.