This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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: 39044
    
  23
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: 39044
    
  23
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