How do you backup / restore any type of databases within my java application to flate files.What are the tools framework open to backup database to flat file like CSV, XML, or secure encoded file, or restore from csv or xml files to databases, it ought to be also able to dumping table vise restore and backup also.

You will find many different ways to get this done. It truly is dependent how complicated your "database" is.

The easiest option would be to create to some text file inside a CSV format:

import java.io.PrintWriter;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;


public class FileOutput {

  public static void main(String[] args) {

    File file = new File("C:\\MyFile.csv");
    FileOutputStream fis = null;
    PrintWriter output = null;

    try {
      fos = new FileOutputStream(file);
      output = new PrintWriter(fos);

      output.println("Column A, Column B, Column C");

      // dispose all the resources after using them.
      outputStream.flush();
      fos.close();
      outputStream.close();

    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
}

Or, if you are searching for an XML solution, you are able to have fun with Xerces API, that we think is incorporated within the latest JDK, so you just need to range from the packages.