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


  • Subject: What record return from getNewRecord() ??
  • From: Martinus Ivan <IVANM@xxxxxxxxxxxxxxxx>
  • Date: Thu, 9 Mar 2000 12:36:16 +0700


> Hi All,
> 
> I have a confusion about getNewRecord() method from RecordFormat Class
> (I'm using ToolBox version from JBuilder/400).
> I create a small PF file call MyData and its only have one field (20 *char
> long).
> I add two record in it. And develop a small java program just to learn the
> characteristic of getNewRecord().
> 
> Base on my code below I don't understand :
>    Why the.......System.out.println(dat.toString()).......print nothing  
> 
> And the disconnectAllServices() didn't work. The program seems do not
> return/finished.
> I'm very sure it not because of object authority problem in AS/400.
> Hope some who have try this method can share it....:)
> Thanks in Advance
> 
> regards,
> Ivan. L
> 
> /*************************************************************************
> **********
> import com.ibm.as400.access.*;
> 
> class filedesc {
>        public static void main (String args[]) {
>       AS400 TheAS400 = new AS400("XXX.XXX.XXX.XXX");
>              
>            try {
>               SequentialFile dataf = new
> SequentialFile(TheAS400,"/QSYS.LIB/MyLib.LIB/MyData.FILE");
>              
>         AS400FileRecordDescription file_desc = new
> AS400FileRecordDescription
>  
> (TheAS400,"/QSYS.LIB/MyLib.LIB/MyData.FILE");
> 
>          //Retrieve the MyData file record format description
>               RecordFormat datarec = file_desc.retrieveRecordFormat()[0];
>       
>         // Set the record format for dataf file object before open it
>         dataf.setRecordFormat(datarec);
> 
>        // Open the file
>  
> dataf.open(AS400File.READ_ONLY,0,AS400File.COMMIT_LOCK_LEVEL_NONE);
>               Record dat = datarec.getNewRecord();
>              System.out.println(dat.toString());
>          }
>      catch(Exception e) {
>       e.printStackTrace();
>          }    
>       
>       mpcas410.disconnectAllServices();
>       
>    }
> }     
> /*****************************************************************
> 
>               
+---
| 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 thread ...


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.