title: SQL "SCRIPT" command to backup h2 database
body: <p>I have an application with <code>h2</code> database. I want to create <code>.sql</code> file using <code>SCRIPT</code> command in Java. </p>
  
  <p>If I am executing it using Prepared Statement:</p>
  
  <pre><code>PreparedStatement stmt = con.prepareStatement("SCRIPT");
  ResultSet rs = stmt.executeQuery();
  </code></pre>
  
  <p>Then how can I able to get whole result in single String. I am new to Java so unable to find the way out to get result of that query because it doesn't contains column names in it.</p>
  
  <p>Then I will write it in file using <code>InputStream</code>.</p>