code: protected void execute(List<String> scripts) throws SQLException
     {
        SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);
  
        // set needed auto commit mode
        boolean autoCommit = connection.getAutoCommit();
        if (autoCommit != this.autoCommit)
        {
           connection.setAutoCommit(this.autoCommit);
        }
  
        Statement st = connection.createStatement();
        try
        {
           for (String scr : scripts)
           {
              String sql = JDBCUtils.cleanWhitespaces(scr.trim());
              if (!sql.isEmpty())
              {
                 if (LOG.isDebugEnabled())
                 {
                    LOG.debug("Execute script: \n[" + sql + "]");
                 }
  
                 executeQuery(st, sql);
              }
           }
        }
        finally
        {
           try
           {
              st.close();
           }
           catch (SQLException e)
           {
              LOG.error("Can't close the Statement." + e.getMessage());
           }
  
           // restore previous auto commit mode
           if (autoCommit != this.autoCommit)
           {
              connection.setAutoCommit(autoCommit);
           }
        }
     }
docs: Execute script on database. Set auto commit mode if needed.
  
  @param scripts
  the scripts for execution
  @throws SQLException