简体   繁体   中英

Export Sql query resultset to a comma separated file using JDBC

I am polling a file from a unix directory , and creating a external directory using following command, and loading the data in the file as table. Later i am applying where condition on the table and the resultset should be exported as a comma separated csv file using JDBC .kindly let me know is it possible, or please point me to some blog .

Create or replace directory   

and

Alter table 

Here is a very good starting place . I personnally use some code inspired by their example and it works great to dump a resultset into a SQL file that you can load into a table very easily. You could adapt it to your needs in a few minutes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM