aspose file tools
The moose likes JDBC and the fly likes how to pass the result of ResultSet to an outputfile Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "how to pass the result of ResultSet to an outputfile" Watch "how to pass the result of ResultSet to an outputfile" New topic
Author

how to pass the result of ResultSet to an outputfile

sagarika chinya
Greenhorn

Joined: Oct 17, 2002
Posts: 11
I am new to java and jdbc, I have used ResultSet to query the database.I wanted to know how to store the result in a outputfile
ie
ResultSet rs = stmt.executeQuery(query);
while(rs.next()) {
String str = rs.getInt("movie_id");
String str2 = rs.getString("ReturnDate")
can i use FileOutputStream,OutputStreamWriter,BufferedWriter and PrintWriter to write the str and str2 into an output file,

any help would be appreciated.
thanks
sagarika
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to pass the result of ResultSet to an outputfile
 
Similar Threads
String Handling
what is the diff? (Strings again)
regarding Strings
string concatenation
How many objects will be created