title: saving a file from a database using JFileChooser
body: <p>I wanted to ask, how to download a file from a database and save it Using Jfilechooser. Can you give me some idea how this would work ? </p>
  
  <pre><code>koneksi_db();
  JFileChooser fs = new JFileChooser();
  fs.setDialogTitle("save a file");
  int result = fs.showSaveDialog(null);
  
  try {
      PreparedStatement ps = conn.prepareStatement("select * from file where nama = ?");
      ResultSet rs = ps.executeQuery();
      if (rs.next()) {
          fs.setCurrentDirectory(new File("/home/me/Documents"));
          int tampak = fs.showSaveDialog(null);
          if (tampak == JFileChooser.APPROVE_OPTION) {
  
          }
      }
  } catch (Exception e) {
      JOptionPane.showMessageDialog(null, "sql error");
  }
  </code></pre>
  
  <p>I don't know what should I do after <code>JFileChooser.APPROVE_OPTION</code>.</p>