Package org.apache.commons.dbutils

Examples of org.apache.commons.dbutils.QueryRunner.update()


   {
      final QueryRunner runner = new QueryRunner();

      for (final String statment : statements.getRemoveStoreStatements())
      {
         runner.update(connection, statment, new Object[] { storeId });
      }
   }

   private synchronized String getNextMessageId(String storeId)
   {
View Full Code Here


      pstmt.execute();
      pstmt.close();

      final QueryRunner runner = new QueryRunner();

      runner.update(connection, "insert into stores values (?, ?, ?, ?)", new Object[] { storeId, destinationName, domain.getId(), messageId });
   }

   public void remove(Connection connection, String storeId, String destination) throws SQLException, JMSException
   {
      final QueryRunner runner = new QueryRunner();
View Full Code Here

   public void remove(Connection connection, String storeId, String destination) throws SQLException, JMSException
   {
      final QueryRunner runner = new QueryRunner();

      if (runner.update(connection, "delete from messages where messageid in (select messageid from stores where storeid=? and destination=?)", new Object[] {
            storeId, destination }) > 0)
      {
         runner.update(connection, "delete from stores where storeid=? and destination=?", new Object[] { storeId, destination });
      }
   }
View Full Code Here

      final QueryRunner runner = new QueryRunner();

      if (runner.update(connection, "delete from messages where messageid in (select messageid from stores where storeid=? and destination=?)", new Object[] {
            storeId, destination }) > 0)
      {
         runner.update(connection, "delete from stores where storeid=? and destination=?", new Object[] { storeId, destination });
      }
   }

   public void remove(Connection connection, String storeId, Message message) throws SQLException, JMSException
   {
View Full Code Here

   public void remove(Connection connection, String storeId, Message message) throws SQLException, JMSException
   {
      final QueryRunner runner = new QueryRunner();

      if (runner.update(connection, "delete from stores where storeid=? and messageid=?", new Object[] { storeId, message.getJMSMessageID() }) > 0)
      {
         runner.update(connection, "delete from messages where messageid=?", new Object[] { message.getJMSMessageID() });
      }
      else
      {
View Full Code Here

   {
      final QueryRunner runner = new QueryRunner();

      if (runner.update(connection, "delete from stores where storeid=? and messageid=?", new Object[] { storeId, message.getJMSMessageID() }) > 0)
      {
         runner.update(connection, "delete from messages where messageid=?", new Object[] { message.getJMSMessageID() });
      }
      else
      {
         throw new SQLException("No message id=" + message.getJMSMessageID() + " exists in store=" + storeId);
      }
View Full Code Here

            {
               progressMonitor.setProgress(statements.length);
               progressMonitor.setNote("Executing statement " + i + " of " + statements.length);
            }

            runner.update(connection, statements[i]);
         }
         catch (SQLException ex)
         {
            log.error(ex.getMessage());
         }
View Full Code Here

   {
      try
      {
         final QueryRunner runner = new QueryRunner();

         runner.update(connection, "insert into storeInfo values ( ? )", new Object[] { storeId });
      }
      catch (SQLException ex)
      {
         log.debug("swallowing " + ex.getMessage());
      }
View Full Code Here

    }

    protected void createTable() throws Exception
    {
        QueryRunner qr = jdbcConnector.getQueryRunner();
        qr.update(jdbcConnector.getConnection(), "CREATE TABLE TEST(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0)  NOT NULL PRIMARY KEY,TYPE INTEGER,DATA VARCHAR(255),ACK TIMESTAMP,RESULT VARCHAR(255))");
        logger.debug("Table created");
    }
   
    protected void deleteTable() throws Exception
    {
View Full Code Here

    }
   
    protected void deleteTable() throws Exception
    {
        QueryRunner qr = jdbcConnector.getQueryRunner();
        int updated = qr.update(jdbcConnector.getConnection(), "DELETE FROM TEST");
        logger.debug(updated + " rows deleted");
    }
   
    protected void populateTable() throws Exception
    {
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.