java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.util.NoSuchElementException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- InputMismatchException
- See Also:
- Top Examples, Source Code,
Enumeration,
Enumeration.nextElement()
public NoSuchElementException()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1188]_
By ashpak_pathan { at } rediffmail { dot } com on 2004/12/11 05:07:40 Rate
When i store the elements in the CSV file at that time this exception found
[1468]Parse string with StringTokenizer
By mousumi_rkl { at } rediffmail { dot } com on 2005/07/01 02:55:21 Rate
package mousumi;
import java.io.*;
import java.util.*;
import xBaseJ.*;
public class trans {
public static void main ( String args [ ] )
{
NumField srno=null;
NumField binkey=null;
NumField Aflskucode=null;
CharField Uomcode=null;
CharField Fifodate=null;
CharField Year=null;
NumField Qty=null;
NumField Qtypicked=null;
CharField Barcodeined=null;
DBF ADB=null;
try {
ADB=new DBF ( "D:/mou/scanmast.dbf" ) ;
System.out.println ( "opening" ) ;
srno= ( NumField ) ADB.getField ( "Invsrno" ) ;
binkey= ( NumField ) ADB.getField ( "Binkey" ) ;
Aflskucode= ( NumField ) ADB.getField ( "Aflskucd" ) ;
Uomcode= ( CharField ) ADB.getField ( "Uomcode" ) ;
Fifodate= ( CharField ) ADB.getField ( "Fifodate" ) ;
Year= ( CharField ) ADB.getField ( "Year" ) ;
Qty= ( NumField ) ADB.getField ( "Qty" ) ;
Qtypicked= ( NumField ) ADB.getField ( "Qtypicked" ) ;
Barcodeined= ( CharField ) ADB.getField ( "BARCODEIND" ) ;
InputStream is=new FileInputStream ( "D:/mou/ritu.txt" ) ;
BufferedReader br= new BufferedReader ( new InputStreamReader ( is ) ) ;
String s = null;
while ( ( s= br.readLine ( ) ) != null )
{
System.out.println ( s ) ;
StringTokenizer s1 = new StringTokenizer ( s,"," ) ;
while ( s1.hasMoreTokens ( ) )
{
String inv=s1.nextToken ( ) ;
System.out.println ( "inv:"+inv ) ;
String bkey=s1.nextToken ( ) ;
System.out.println ( "bkey:"+bkey ) ;
String bincd=s1.nextToken ( ) ;
System.out.println ( "bincd:"+bincd ) ;
String aflskucd=s1.nextToken ( ) ;
String aflscd=aflskucd.substring ( 1,9 ) ;
System.out.println ( "aflscd:"+aflscd ) ;
String Uom=aflskucd.substring ( 9,13 ) ;
System.out.println ( "Uom"+Uom ) ;
String fifo=aflskucd.substring ( 13, ( aflskucd.length ( ) -1 ) ) ;
System.out.println ( "fifo"+fifo ) ;
String year=fifo.substring ( ( fifo.length ( ) -2 ) ,fifo.length ( ) ) ;
System.out.println ( "year"+year ) ;
//System.out.println ( "name:"+aflscd ) ;
String custscd=s1.nextToken ( ) ;
System.out.println ( "custcd"+custscd ) ;
String qty=s1.nextToken ( ) ;
System.out.println ( "qty"+qty ) ;
String Qtysofar=s1.nextToken ( ) ;
System.out.println ( "qtysofar"+qty ) ;
String flag=s1.nextToken ( ) ;
System.out.println ( "err ck"+flag ) ;
}
System.out.print ( "after write" ) ;
}
} catch ( FileNotFoundException e7 ) {
// TODO Auto-generated catch block
e7.printStackTrace ( ) ;
} catch ( IOException e11 ) {
// TODO Auto-generated catch block
e11.printStackTrace ( ) ;
} catch ( xBaseJException e1111 ) {
// TODO Auto-generated catch block
e1111.printStackTrace ( ) ;
}
}
private static void Qtypicked ( String qty ) {
// TODO Auto-generated method stub
} //end of 1st if
}
public NoSuchElementException(String s)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples