Package org.xmlBlaster.contrib.db

Examples of org.xmlBlaster.contrib.db.I_DbPool.update()


            }
         }
         {
            try {
               sql = "DROP TABLE " + this.tableName;
               pool.update(sql);
               Thread.sleep(500L);
               conn = this.pool.reserve();
               Statement st = conn.createStatement();
               ResultSet rs = st.executeQuery("SELECT * from " + this.replPrefix + "items");
               assertEquals("Testing DROP table '" + this.tableName + "' checking that the operation generated an entry in " + this.replPrefix + "items", true, rs.next());
View Full Code Here


      try {
         conn  = pool.reserve();
         conn.setAutoCommit(true);
         String sql = null;
         sql = "CREATE TABLE " + this.tableName + " (first DATE, PRIMARY KEY(first))";
         pool.update(sql);

         this.dbSpecific.readNewTable(null, this.specificHelper.getOwnSchema(this.pool), this.dbHelper.getIdentifier(this.tableName), null, true);
         try {
            this.pool.update("DELETE from " + this.replPrefix + "items");
            // long time = System.currentTimeMillis();
View Full Code Here

         String sql = null;
         String type = "TIMESTAMP";
         // TODO remove this after testing
         type = "DATE";
         sql = "CREATE TABLE " + this.tableName + " (first " + type + ", PRIMARY KEY(first))";
         pool.update(sql);

         this.dbSpecific.readNewTable(null, this.specificHelper.getOwnSchema(this.pool), this.dbHelper.getIdentifier(this.tableName), null, true);
         try {
            this.pool.update("DELETE from " + this.replPrefix + "items");
            // long time = System.currentTimeMillis();
View Full Code Here

      log.info("Start " + txt);
     
      I_DbPool pool = (I_DbPool)info.getObject("db.pool");
      assertNotNull("pool must be instantiated", pool);
      try {
         pool.update("DROP TABLE PERFORM");
      }
      catch (SQLException ex) {
         log.info("An Exception here is allowed");
      }
     
View Full Code Here

      }
      catch (SQLException ex) {
         log.info("An Exception here is allowed");
      }
     
      pool.update("CREATE TABLE PERFORM (name1 VARCHAR(20), name2 VARCHAR(128), name3 BLOB, primary key (name1))");

      Connection conn = pool.reserve();
      conn.setAutoCommit(false);
      String sql = "INSERT INTO PERFORM VALUES (?, ?, ?)";
      byte[] blob = new byte[1024];
View Full Code Here

         st.executeBatch();
         conn.commit();
         long t1 = System.currentTimeMillis();
         long dt = t1-t0;
         log.info("batch statements='" + nmax + "' took '" + dt + "' ms (per statement: " + dt/nmax + ")");
         pool.update("delete from PERFORM");
         conn.commit();
      }
      {
         long t0 = System.currentTimeMillis();
         for (int i=0; i < nmax; i++) {
View Full Code Here

         }
         conn.commit();
         long t1 = System.currentTimeMillis();
         long dt = t1-t0;
         log.info("non-batch (single commit) statements='" + nmax + "' took '" + dt + "' ms (per statement: " + dt/nmax + ")");
         pool.update("delete from PERFORM");
         conn.commit();
      }
      {
         long t0 = System.currentTimeMillis();
         for (int i=0; i < nmax; i++) {
View Full Code Here

            conn.commit();
         }
         long t1 = System.currentTimeMillis();
         long dt = t1-t0;
         log.info("non-batch (all commit) statements='" + nmax + "' took '" + dt + "' ms (per statement: " + dt/nmax + ")");
         pool.update("delete from PERFORM");
         conn.commit();
      }

      pool.update("DROP TABLE PERFORM");
      pool.release(conn);
View Full Code Here

         log.info("non-batch (all commit) statements='" + nmax + "' took '" + dt + "' ms (per statement: " + dt/nmax + ")");
         pool.update("delete from PERFORM");
         conn.commit();
      }

      pool.update("DROP TABLE PERFORM");
      pool.release(conn);
      log.info("SUCCESS");
   }

   /**
 
View Full Code Here

      String[] sqls = specificHelper.getSql(this.tableName);
      try {
         for (int i=0; i < sqls.length; i++) {
            try {
               try {
                  pool.update("DROP TABLE " + this.tableName + specificHelper.getCascade());
               }
               catch (Exception e) {
               }
               pool.update(sqls[i]);
               // don't do this since oracle 10.1.0 returns zero (don't know why)
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.