Package com.dotmarketing.common.db

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


        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){
      String stInode = tree.get("parent");
View Full Code Here


        addtemplate=addtemplate.replaceAll("varchar\\(", "varchar2\\(");
    String addFK = "ALTER TABLE htmlpage add constraint template_id_fk foreign key (template_id) references identifier(id)";
    String htmlQuery = "Select * from tree where child in(Select inode from inode where type='htmlpage') and "
           + "parent in(select identifier from template)";
   
    dc.executeStatement(addtemplate);
    dc.executeStatement(addFK);
   
    dc.setSQL(htmlQuery);
    List<Map<String, String>> treeResults = dc.loadResults();
    for(Map<String,String> tree : treeResults){
View Full Code Here

    String addFK = "ALTER TABLE htmlpage add constraint template_id_fk foreign key (template_id) references identifier(id)";
    String htmlQuery = "Select * from tree where child in(Select inode from inode where type='htmlpage') and "
           + "parent in(select identifier from template)";
   
    dc.executeStatement(addtemplate);
    dc.executeStatement(addFK);
   
    dc.setSQL(htmlQuery);
    List<Map<String, String>> treeResults = dc.loadResults();
    for(Map<String,String> tree : treeResults){
      String templateId = tree.get("parent");
View Full Code Here

                 "fetch next from cur_Inserted3 into @newFolder,@newHost\n" +
                 "END;";
    }
    List<String> triggers = SQLUtil.tokenize(trigger);
    for(String t:triggers){
      dc.executeStatement(t);
    }
  }
 
  private void addTriggerToHTMLPage() throws SQLException {
    DotConnect dc = new DotConnect();
View Full Code Here

                      "END IF;\n" +
                      "END\n" +
                      "#";
      List<String> triggers = SQLUtil.tokenize(mysqlTrigger);
      for(String t:triggers){
        dc.executeStatement(t);
      }
    }
    if(UtilMethods.isSet(trigger)){
      dc.executeStatement(trigger);
    }
View Full Code Here

    DotConnect dc = new DotConnect();
    HibernateUtil.startTransaction();
      try {
      conn = DbConnectionFactory.getConnection();
        if (DbConnectionFactory.isMySql())
         dc.executeStatement("SET storage_engine=INNODB", conn);
        if (DbConnectionFactory.isMsSql())
           dc.executeStatement("SET TRANSACTION ISOLATION LEVEL READ COMMITTED");
        workflowTaskChanges();
        workflowCommentChanges();
        workflowHistoryChanges();
View Full Code Here

      try {
      conn = DbConnectionFactory.getConnection();
        if (DbConnectionFactory.isMySql())
         dc.executeStatement("SET storage_engine=INNODB", conn);
        if (DbConnectionFactory.isMsSql())
           dc.executeStatement("SET TRANSACTION ISOLATION LEVEL READ COMMITTED");
        workflowTaskChanges();
        workflowCommentChanges();
        workflowHistoryChanges();
    } catch (SQLException e) {
      HibernateUtil.rollbackTransaction();
View Full Code Here

        if (DbConnectionFactory.isMySql())
          alterSql = "alter table workflowtask_files drop foreign key FK_task_file_inode ";
        else
          alterSql = "alter table workflowtask_files drop constraint FK_task_file_inode ";

        dc.executeStatement(alterSql);

    }


    public void executeUpgrade() throws DotDataException, DotRuntimeException {
View Full Code Here

        if (DbConnectionFactory.isMsSql()) {
          DotConnect dc = new DotConnect();
          String alterSql = "alter table tag drop constraint tag_tagname_host;" +
              "alter table tag alter column tagname nvarchar(255) null;" +
              "alter table tag add constraint tag_tagname_host unique (tagname, host_id);";
          dc.executeStatement(alterSql);
        }
    }


    public void executeUpgrade() throws DotDataException, DotRuntimeException {
View Full Code Here

    void alterProcedure() throws SQLException {
      DotConnect dc=new DotConnect();

        if(DbConnectionFactory.isMsSql()) {
            dc.executeStatement("ALTER TABLE TEMPLATE ADD DRAWED tinyint");
            dc.executeStatement("ALTER TABLE TEMPLATE ADD DRAWED_BODY text");
            dc.executeStatement("ALTER TABLE TEMPLATE ADD ADD_CONTAINER_LINKS int");
            dc.executeStatement("ALTER TABLE TEMPLATE ADD CONTAINERS_ADDED int");
            dc.executeStatement("ALTER TABLE TEMPLATE ADD HEAD_CODE text");
            dc.executeStatement("ALTER TABLE CONTAINERS ADD FOR_METADATA tinyint");
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.