Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating a text file based on the the form information

 
Gaurav Kalra
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i create a text file based on the inputs obtained from a form. Also how do i create a resultset which is not forward only. The method setDirection is not working correctly.
 
Andrew Shafer
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The parameters gathered from the form are String objects. IO works the same in JSP, to write to a file you need to instantiate a FileWriter object.
This can either be handled in the JSP file or in a bean that the JSP will use.
This is one suggestion that will work.
(you must import "java.io.*")

After that you can call form.print() or any other PrintWriter methods and it will write to your file.
I don't understand your question about result sets.
Also, even though you are using this on a JSP, your questions are really about I/O and JDBC respectively. You might get better answers in those forums.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for your resultset question, it depends on teh JDBC driver you are using. JDBC 2.0 drivers to support moving forward/backward withing the resultset.
Bosun
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic