File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes export query from table column to text file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "export query from table column to text file" Watch "export query from table column to text file" New topic
Author

export query from table column to text file

aypa genga
Greenhorn

Joined: Nov 26, 2008
Posts: 5
I want to export a single column of a table to a text file. How can i do it with a sql query.
Please help
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37950
    
  22
Use a simple select statement, then write the results to the text file with a FileWriter or Formatter.
avani vakharwala
Greenhorn

Joined: Jan 24, 2008
Posts: 6

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37950
    
  22
avani vakharwala welcome to JavaRanch

And thank you.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: export query from table column to text file
 
Similar Threads
Can i store bold/italic text modified in JTextpane in Database??
java code to export mssql data into csv file
How to preserve new lines when parsing
Looking for a database to Java code generator
Loading Data in Table