If ne1 can help it would be very appreciated. Im running out of time.
Im trying to read records from a text file and put them in a vector but all im getting in the vector is nulls.
I didnt set the varibles to any length so i cant tell the do while loop when to stop.
Is dere any way to get around this?
public void openStream()
File inFile = new File(strBookLoc);
FileInputStream inFileStream = new FileInputStream(inFile);
InputStreamReader in = new InputStreamReader(inFileStream);
BufferedReader bufReader = new BufferedReader(in);
strTitle = bufReader.readLine();
strAuthor = bufReader.readLine();
strPrice = bufReader.readLine();
strStock = bufReader.readLine();
strDescription = bufReader.readLine();
if (strTitle != null)
intPrice = Integer.parseInt(strPrice);
intStock = Integer.parseInt(strStock);
i = i + 1;
Bookc bk = new Bookc(strTitle, strAuthor, intPrice, intStock, strDescription);
}while(strTitle != null);
catch (IOException e)
System.out.println("Error reading from file.");
System.out.println("Error message "+e.toString());
Its alright i fixed my problem.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL