public void createTables(TableCreationMode mode){
  ArrayList<Type<?>> sorted=sortTypes();
  try (Connection connection=getConnection();Statement statement=connection.createStatement()){
    connection.setAutoCommit(false);
    if (mode == TableCreationMode.DROP_CREATE) {
      executeDropStatements(statement);
    }
    for (    Type<?> type : sorted) {
      String sql=tableCreateStatement(type,mode);
      statementListeners.beforeExecuteUpdate(statement,sql,null);
      statement.execute(sql);
      statementListeners.afterExecuteUpdate(statement);
    }
    for (    Type<?> type : sorted) {
      createIndexes(connection,mode,type);
    }
    connection.commit();
  }
 catch (  SQLException e) {
    throw new TableModificationException(e);
  }
}

public void createTables ( TableCreationMode mode ) { ArrayList < Type < ? > > sorted = sortTypes ( ) ; try ( Connection connection = getConnection ( ) ; Statement statement = connection . createStatement ( ) ) { connection . setAutoCommit ( false ) ; if ( mode == TableCreationMode . DROP_CREATE ) { executeDropStatements ( statement ) ; } for ( Type < ? > type : sorted ) { String sql = tableCreateStatement ( type , mode ) ; statementListeners . beforeExecuteUpdate ( statement , sql , null ) ; statement . execute ( sql ) ; statementListeners . afterExecuteUpdate ( statement ) ; } for ( Type < ? > type : sorted ) { createIndexes ( connection , mode , type ) ; } connection . commit ( ) ; } catch ( SQLException e ) { throw new TableModificationException ( e ) ; } }
create the tables over the connection .
