title: How to drop a function with Hibernate/JDBC?
body: <p>I'm trying to run this query</p>
  
  <pre><code>drop FUNCTION IF EXISTS time_factor;
  </code></pre>
  
  <p>I want to run it through the Hibernate session with either <code>createSQLQuery()</code> or <code>doWork()</code>.
  Like this:</p>
  
  <pre><code>sessionFactory.getCurrentSession().createSQLQuery(query).executeUpdate();
  </code></pre>
  
  <p>or</p>
  
  <pre><code>sessionFactory.getCurrentSession().doWork(new Work() {
          @Override
          public void execute(Connection connection) throws SQLException {
              connection.prepareStatement(query).executeUpdate();
          }
  });
  </code></pre>
  
  <p>This is what I get:</p>
  
  <pre><code>Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "DROP FUNCTION[*] IF EXISTS TIME_FACTOR; "; expected "TABLE, INDEX, USER, SEQUENCE, CONSTANT, TRIGGER, VIEW, ROLE, ALIAS, SCHEMA, ALL, DOMAIN, TYPE, DATATYPE, AGGREGATE";
  </code></pre>
  
  <p>Does this mean that I can't drop functions through JDBC/Hibernate ?</p>
  
  <p>Also if someone knows a way I can run it I'd be really grateful.</p>