Package com.dotmarketing.common.db

Examples of com.dotmarketing.common.db.DotConnect.executeStatement()


                DbConnectionFactory.isMsSql()){
        dc.executeStatement("create index idx_workflow_4 on workflow_task (webasset)");
        dc.executeStatement("create index idx_workflow_5 on workflow_task (created_by)");
        dc.executeStatement("create index idx_workflow_2 on workflow_task (belongs_to)");
        dc.executeStatement("create index idx_workflow_3 on workflow_task (status)");
        dc.executeStatement("create index idx_workflow_1 on workflow_task (assigned_to)");
      }
    }

  public void executeUpgrade() throws DotDataException, DotRuntimeException {
    Connection conn = null;
View Full Code Here


  public void executeUpgrade() throws DotDataException, DotRuntimeException {
    try {
      DbConnectionFactory.getConnection().setAutoCommit(true);
      DotConnect dc = new DotConnect();
      try {
        dc.executeStatement("drop table container_structures");
      } catch (SQLException e) {
        Logger.info(getClass(),
            "container_structures table does not exist. Will be created.");
      }
      String createTable = "Create table container_structures"
View Full Code Here

            "varchar2\\(");
        createTable = createTable.replaceAll("text", "nclob");
      } else if (DbConnectionFactory.isMySql()) {
        createTable = createTable.replaceAll("text", "longtext");
      }
      dc.executeStatement(createTable);
    } catch (SQLException e) {
      throw new DotDataException(e.getMessage(), e);
    }
  }
View Full Code Here

                       + "parent in(select inode from structure)";
   
    String delete_template_htmlpage = "Delete from tree where child in(select inode from inode where type='htmlpage') and "
                    + "parent in(select identifier from template)";
   
    dc.executeStatement(delete_host_containers);
    dc.executeStatement(delete_host_template);
    dc.executeStatement(delete_host_folders);
    dc.executeStatement(delete_folder_folder);
    dc.executeStatement(delete_structure_containers);
    dc.executeStatement(delete_template_htmlpage);
View Full Code Here

   
    String delete_template_htmlpage = "Delete from tree where child in(select inode from inode where type='htmlpage') and "
                    + "parent in(select identifier from template)";
   
    dc.executeStatement(delete_host_containers);
    dc.executeStatement(delete_host_template);
    dc.executeStatement(delete_host_folders);
    dc.executeStatement(delete_folder_folder);
    dc.executeStatement(delete_structure_containers);
    dc.executeStatement(delete_template_htmlpage);
  }
View Full Code Here

    String delete_template_htmlpage = "Delete from tree where child in(select inode from inode where type='htmlpage') and "
                    + "parent in(select identifier from template)";
   
    dc.executeStatement(delete_host_containers);
    dc.executeStatement(delete_host_template);
    dc.executeStatement(delete_host_folders);
    dc.executeStatement(delete_folder_folder);
    dc.executeStatement(delete_structure_containers);
    dc.executeStatement(delete_template_htmlpage);
  }
   
View Full Code Here

                    + "parent in(select identifier from template)";
   
    dc.executeStatement(delete_host_containers);
    dc.executeStatement(delete_host_template);
    dc.executeStatement(delete_host_folders);
    dc.executeStatement(delete_folder_folder);
    dc.executeStatement(delete_structure_containers);
    dc.executeStatement(delete_template_htmlpage);
  }
   
  private void containerTableChanges() throws DotDataException, SQLException {
View Full Code Here

   
    dc.executeStatement(delete_host_containers);
    dc.executeStatement(delete_host_template);
    dc.executeStatement(delete_host_folders);
    dc.executeStatement(delete_folder_folder);
    dc.executeStatement(delete_structure_containers);
    dc.executeStatement(delete_template_htmlpage);
  }
   
  private void containerTableChanges() throws DotDataException, SQLException {
    DotConnect dc = new DotConnect();
View Full Code Here

    dc.executeStatement(delete_host_containers);
    dc.executeStatement(delete_host_template);
    dc.executeStatement(delete_host_folders);
    dc.executeStatement(delete_folder_folder);
    dc.executeStatement(delete_structure_containers);
    dc.executeStatement(delete_template_htmlpage);
  }
   
  private void containerTableChanges() throws DotDataException, SQLException {
    DotConnect dc = new DotConnect();
    String addStructure = "ALTER TABLE containers add structure_inode varchar(36)";
View Full Code Here

    if(DbConnectionFactory.isOracle())
        addStructure=addStructure.replaceAll("varchar\\(", "varchar2\\(");
    String addFK = "ALTER TABLE containers add constraint structure_fk foreign key (structure_inode) references structure(inode)";
    String containerQuery = "Select * from tree where child in(Select inode from inode where type='containers') and "
           + "parent in(select inode from structure)";
    dc.executeStatement(addStructure);
    dc.executeStatement(addFK);
   
    dc.setSQL(containerQuery);
    List<Map<String, String>> treeResults = dc.loadResults();
    for(Map<String,String> tree : treeResults){
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.