title: How can I run a script file using the "source" command?
body: <p>I am coding an application that connects to a localhost. When the application first runs I want it to initialize the Database using this method:</p>
  
  <pre><code>public void initDataBase() {
      try {
          Statement stm = con.createStatement();
          stm.executeQuery("source shippingSQLscript.sql");
      } catch (SQLException ex) {
          ex.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Where shippingSQLscript.sql contains the correct sql statements to insert all the data. However when I run it the method throws:</p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 
  You have an error in your SQL syntax; check the manual that corresponds to your 
  MySQL server version for the right syntax to use near 'source shippingSQLscript.sql'
  at line 1
  </code></pre>
  
  <p>I have tried using <code>stm.execute()</code> as well but have had the same result.</p>