Package it.eng.spagobi.engines.console

Examples of it.eng.spagobi.engines.console.ConsoleEngineRuntimeException


      JSONObject metaParams = getAttributeAsJSONObject( "metaParams" );
      logger.debug("Parameter [metaParams] is equals to [" + metaParams + "]");
     
      boolean result = utility.executeUpdateQuery(params, metaParams);
      if ( !result ){
        throw new ConsoleEngineRuntimeException("Impossible to perform update statement");   
      }
     
      try {
        writeBackToClient( new JSONAcknowledge() );
      } catch (IOException e) {
View Full Code Here


      logger.debug("Query parameter [resourceIdParam] is equals to [" + resourceIdParam + "]");     
   
      try {
        stmt = conn.prepareStatement(sql);
      } catch (SQLException e) {
        throw new ConsoleEngineRuntimeException("Impossible to create a prepared statement for query [" + sql + "]", e);
      }
     
      try {
        stmt.setDouble(1, idServiceInstanceParam);
        stmt.setInt(2, idServiceParam);
        //stmt.setDate(3, sysDate);
        stmt.setTimestamp(3, sysDate);
        stmt.setString(4, pidParam);
        //stmt.setDate(5, sysDate);
        stmt.setTimestamp(5, sysDate);
        stmt.setInt(6, resourceIdParam.intValue());
      } catch (SQLException e) {
        throw new ConsoleEngineRuntimeException("Impossible to set the value of the parameter [resourceName] to [" + resourceName + "] in query [" + sql + "]", e);
      }
      logger.debug("Prameters has been  succesfully replaced in statement  [" + stmt.toString() + "]");
     
      try {
        stmt.executeUpdate();
      } catch (SQLException e) {
          logger.error("Query parameter [pid] is equals to [" + pidParam + "]");
          logger.error("Query parameter [resourceIdParam] is equals to [" + resourceIdParam + "]");
          logger.error("Query parameter [idServiceParam] is equals to [" + idServiceParam + "]");
          logger.error("Query parameter [sysDate] is equals to [" + sysDate + "]");
          logger.error("Query parameter [idServiceInstanceParam] is equals to [" + idServiceInstanceParam + "]");
        throw new ConsoleEngineRuntimeException("Impossible to execute statement [" + stmt.toString() + "]", e);
      }
      logger.debug("Statement [" + stmt.toString() + "] has been  succesfully executed");
   
      conn.commit();
               
View Full Code Here

      sqlSelect = "SELECT ID_VAL FROM ID_GEN WHERE ID_NAME='SERVICE_INSTANCE_ID'";
     
      try {
        stmtUpdate = conn.prepareStatement(sqlUpdate);
      } catch (SQLException e) {
        throw new ConsoleEngineRuntimeException("Impossible to create a prepared statement for query [" + sqlUpdate + "]", e);
      }
      logger.debug("Statement [" + stmtUpdate.toString() + "] has been succesfully created");
     
      try {
        stmtUpdate.executeUpdate();
      } catch (SQLException e) {
        throw new ConsoleEngineRuntimeException("Impossible to execute statement [" + stmtUpdate.toString() + "]", e);
      }
      logger.debug("Statement [" + stmtUpdate.toString() + "] has been  succesfully executed");
     
     
      try {
        stmtSelect = conn.prepareStatement(sqlSelect);
      } catch (SQLException e) {
        throw new ConsoleEngineRuntimeException("Impossible to create a prepared statement for query [" + sqlUpdate + "]", e);
      }
      logger.debug("Statement [" + stmtSelect.toString() + "] has been succesfully created");
     
      try {
        stmtSelect.execute();
      } catch (SQLException e) {
        throw new ConsoleEngineRuntimeException("Impossible to execute statement [" + stmtSelect.toString() + "]", e);
      }
      logger.debug("Statement [" + stmtSelect.toString() + "] has been  succesfully executed");
     
     
      resultSet = stmtSelect.getResultSet();
      Assert.assertTrue(resultSet.getMetaData().getColumnCount() > 0, "The query [" + stmtSelect.toString()+ "] returned a multicolumn resultset");
      if(resultSet.next()) {
        idServiceInstance = new Double( resultSet.getDouble(1) );
      } else {
        Assert.assertUnreachable("The query [" + stmtSelect.toString()+ "] returned no results");
      }
     
      Assert.assertTrue(!resultSet.next(), "The query [" + stmtSelect.toString()+ "] returned more than one record");
     
      conn.commit();
     
    } catch(Throwable t ) {
      throw new ConsoleEngineRuntimeException("Impossible to get resource id", t);
    } finally {
      releaseResources(null, stmtUpdate, null);
      releaseResources(null, stmtSelect, resultSet);
      logger.debug("OUT");
   
View Full Code Here

      sql = "SELECT RESOURCE_ID FROM SBI_RESOURCES WHERE RESOURCE_NAME = ?";
     
      try {
        stmt = conn.prepareStatement(sql);
      } catch (SQLException e) {
        throw new ConsoleEngineRuntimeException("Impossible to create a prepared statement for query [" + sql + "]", e);
      }
      logger.debug("Statement [" + stmt.toString() + "] has been succesfully created");
     
      try {
        stmt.setString(1, resourceName);
      } catch (SQLException e) {
        throw new ConsoleEngineRuntimeException("Impossible to set the value of the parameter [resourceName] to [" + resourceName + "] in query [" + sql + "]", e);
      }
      logger.debug("Prameters has been  succesfully replaced in statement  [" + stmt.toString() + "]");
     
      try {
        stmt.execute();
      } catch (SQLException e) {
        throw new ConsoleEngineRuntimeException("Impossible to execute statement [" + stmt.toString() + "]", e);
      }
      logger.debug("Statement [" + stmt.toString() + "] has been  succesfully executed");
     
     
      resultSet = stmt.getResultSet();
      Assert.assertTrue(resultSet.getMetaData().getColumnCount() > 0, "The query [" + stmt.toString()+ "] returned a multicolumn resultset");
      if(resultSet.next()) {
        resourceId = new Integer( resultSet.getInt(1) );
      } else {
        Assert.assertUnreachable("The query [" + stmt.toString()+ "] returned no results");
      }
     
      Assert.assertTrue(!resultSet.next(), "The query [" + stmt.toString()+ "] returned more than one record");
     
    } catch(Throwable t ) {
      throw new ConsoleEngineRuntimeException("Impossible to get resource id", t);
    } finally {
      releaseResources(null, stmt, resultSet);
      logger.debug("OUT");
    }
   
View Full Code Here

TOP

Related Classes of it.eng.spagobi.engines.console.ConsoleEngineRuntimeException

Copyright © 2018 www.massapicom. 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.