my dog learned polymorphism*
The moose likes Beginning Java and the fly likes returning bufferedreader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "returning bufferedreader" Watch "returning bufferedreader" New topic
Author

returning bufferedreader

Hosh Nasi
Ranch Hand

Joined: Sep 10, 2004
Posts: 44
I have a method that creates a bufferedreader and it suppose to return it to the calling class.

However I am having issues.



The method is held in what I call the DatabaseUtil class, in the final version of the program I will be connecting to a SQL database until then I am using a simple flatfile. So I want to keep connections, query, and linereading in the class. However I want the Factory to be able to loop through the fields that are returned

How can I get this to compile. The try block is hanging me up.
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
No guarantee in this reply, just re-learning Java, but it looks like your method should be returning a BufferedReader, yet you return a string. I guess you should be returning the BufferedReader instead.

Apologies if I'm wrong.

Mike
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
Duh, that wasn't right. You're assigning msgString to a BufferedReader, but how is msgString declared? What's the compiler message? Should be a BufferedReader?
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
How can I get this to compile. The try block is hanging me up.

How so? Are you getting an error message? If so, what is it?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: returning bufferedreader