title: How to use org.springframework.jdbc.object to implement reusable ddl statements?
body: <p>I would like to use entities from <code>org.springframework.jdbc.object</code> package for modeling access to database.</p>
  <p>It is clear how to create objects for select, update, insert and delete queries. We can just extend <code>MappingSqlQuery&lt;?&gt;</code> or <code>SqlUpdate</code> then declare all the parameters, collect named parameters in some map and execute statement <code>stmt.executeByNamedParam(Map&lt;String, ?&gt; paramMap);</code>.</p>
  <p>It is not clear how we can use <code>org.springframework.jdbc.object</code> package to implement ddl statements like schema/table creation, or altering table.
  For example I would like to create schema dynamically, the query look like this: <code>create schema if not exists schema_name</code>.
  I create statement in next way:</p>
  <pre><code>public final class CreateSchemaStmt extends SqlUpdate {
  
      private static final String CREATE_SCHEMA_SQL_TEMPLATE =
              &quot;create schema if not exists ?&quot;;
  
      public CreateSchemaStmt(DataSource ds) {
          setDataSource(ds);
          setSql(CREATE_SCHEMA_SQL_TEMPLATE);
          declareParameter(new SqlParameter(&quot;schema&quot;, Types.VARCHAR));
          compile();
      }
  }
  </code></pre>
  <p>But it is not possible to declare parameter in such a way and pass it to statement execution.
  Of course I can always create a new statement when I need to create new schema/table or alter table (with sql query without placeholders), but in this case this statement will not be reusable.</p>
  <p>Could such kind of query be created and executed with named parameters?</p>