|
Hi Folks, Can anyone explain to me why i am getting these errors when compileing in va java. The type named recordFormat is not defined. The method getField invoked for type com.ibm.as400.access. RecordFormat with arguments [java.lang.String] is not defined. The variable named SCDESCField is not defined. I am trying to take a passed parameter "SEMESTER" (5 digit number) and retrieve a record equal to "SEMESTER". I then want to pick up a description field in that record ("SCDESCField") public void getReqInfo(HttpServletRequest req, PrintWriter out) throws ServletException, IOException { // Create an AS400 object. AS400 sys = new AS400("mis.marywood.edu"); // Create a file object that represents the file KeyedFile SEMPCNTL = new KeyedFile(sys, "/QSYS.LIB/DATALIBR.LIB/SEMPCNTL.FILE/%FILE%.MBR"); // Assume that the AS400FileRecordDescription class was used to generate the code for // a subclass of RecordFormat that represents the record format of file SEMPCNTL in // library DATALIBR. RecordFormat recordFormat = new recordFormat(); // Set the record format for SEMPCNTL. This must be done prior to invoking open() SEMPCNTL.setRecordFormat(recordFormat); // Open the file. SEMPCNTL.open(AS400File.READ_WRITE, 0, AS400File.COMMIT_LOCK_LEVEL_NONE); // The record format for the file contains one key field, SCREG Object[] key = new Object[1]; key[0] = new Integer(req.getParameter("SEMESTER")); // Read the first record matching key Record keyedRecord = SEMPCNTL.read(key); // If the record was not found, null is returned. if (keyedRecord != null) { // Found the record, print out the info. // Retrieve the field value of Semester Description String SCDESCField=(String)recordFormat.getField("SCDESC"); System.out.println("Semester Information for " + (String)key[0] + ":"); System.out.println(keyedRecord); } // Close the file since I am done using it SEMPCNTL.close(); // Disconnect since I am done using record-level access sys.disconnectService(AS400.RECORDACCESS); out.Println("You have selected the" + SCDESCField + "semester"); out.println("<H4><B>Additional Request Information:</B></H4>"); out.println("<B>Request method:</B> " + req.getMethod() + "<BR>"); out.println("<B>Request URI:</B> " + req.getRequestURI() + "<BR>"); out.println("<B>Servlet path:</B> " + req.getServletPath() + "<BR>"); out.println("<B>Servlet name:</B> " + req.getServerName() + "<BR>"); out.println("<B>Path info:</B> " + req.getPathInfo() + "<BR>"); } THANKS IN ADVANCE! Michael P. Gibbons Manager of Programming & Technical Services MARYWOOD UNIVERSITY 2300 Adams Ave. Scranton, PA 18509 +--- | 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-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.