I have created a sample program using the DataContext
class to get records from an oracle11g
table, and write its data to CSV file.
Here is my code for getting table and write into a CSV.
UpdateableDataContext dataContext = DataContextFactory.createCsvDataContext(tmpCSV);
TableCreationBuilder table = callback.createTable(getDataContext().getDefaultSchema(),"Table1").execute();
RowInsertionBuilder insert = callback.insertInto(table);
//we are getting each column from each record and than run
insert.value("columnName","value")
//After inserting all records we are execute below command to insert data into csv
insert.execute();
I want to do the same thing with creating a view, and putting its data into a CSV file.
How can I use DataContext
in java for creating views, and then writing the view's data into a CSV file?