title: How do I get the raw script output instead of the query result from an Oracle SQL select in Java
body: <p>I need to backup some data as INSERT statements through a Java application. The most straight-forward approach I could find in SQL Developer was running a select with <code>/*insert*/</code>. </p>
  
  <p>For example:</p>
  
  <pre><code>SELECT /*insert*/ * FROM table_name WHERE col_a = 1 AND col_b = 2;
  </code></pre>
  
  <p>If I run this query as a script (F5) in SQL Developer I get its result just like I need. The problem is I can't find a way to run this query as a script from my Java application and get the DB text output back to the program. I'd like to receive the script output as a String, then print it to a file.</p>
  
  <p>Conventionally I run all my queries with <code>JdbcTemplate</code> and <code>PreparedStatementCreator</code>, but all methods in <code>JdbcTemplate</code> seem to require some sort of row mapping to transfer the query content to an object's attributes.</p>