• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to pass the result of ResultSet to an outputfile

 
sagarika chinya
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!