Package org.jboss.soa.esb.helpers.persist

Examples of org.jboss.soa.esb.helpers.persist.JdbcCleanConn


      _logger.info("@Starting HSQL database");
        try
        {
          Class.forName(mDbDriver);
            server = HsqldbUtil.startHsqldb(_dbFileName, "defaultReplyEprDB");
            _dbConn = new JdbcCleanConn
          (new SimpleDataSource(mDbDriver,mDbUrl,mDbUsername,mDbPassword));
            createMessageTable("foo");
            createMessageTable("foo_reply_table");
        }
        catch (Exception e)
View Full Code Here


        }
    } // ________________________________

    protected List<Map<String, Object>> pollForCandidates() {
        List<Map<String, Object>> oResults = new ArrayList<Map<String, Object>>();
        final JdbcCleanConn oConn = getDbConn();
       
        ResultSet RS = null;
       
        try {
            RS = oConn.execQueryWait(_PSscan, 1);
            ResultSetMetaData meta = RS.getMetaData();
            while (RS.next()) {
                Map<String, Object> row = new HashMap<String, Object>();
                for (int iCurr = 1; iCurr <= meta.getColumnCount(); iCurr++) {
                    String sCol = meta.getColumnName(iCurr);
                    if (!_inProcessField.equalsIgnoreCase(sCol)) {
                        final int type = meta.getColumnType(iCurr) ;
                        if (type == Types.BLOB) {
                            final Blob blob = RS.getBlob(iCurr) ;
                            row.put(sCol, ((blob != null) ? StreamUtils.readStreamString(blob.getBinaryStream(), "UTF-8") : null));
                        } else if (type == Types.CLOB) {
                            final Clob clob = RS.getClob(iCurr) ;
                            row.put(sCol, ((clob != null) ? StreamUtils.readReader(clob.getCharacterStream()) : null));
                        } else {
                            row.put(sCol, RS.getObject(iCurr));
                        }
                    }
                }

                oResults.add(row);
            }
        }
        catch (Exception e) {
            _logger.debug("Some triggers might not have been returned", e);
        }
        finally {
            try {
          if (RS != null)
              RS.close();
         
                oConn.rollback();
            } catch (final SQLException sqle) {
              refreshDatasource();
            }
        }
        if (_logger.isDebugEnabled()) {
View Full Code Here

           * Create JdbcCleanConn even if oDS is null because that will
           * manage the error handling for us by throwing SQLExceptions
           * at the appropriate time.
           */
         
          _dbConn = new JdbcCleanConn(oDS, transacted);
        }
     
        if ((null != _dbConn) && (_dbConn.getStatements().size() == 0)) {
          try {
        prepareStatements();       
View Full Code Here

        } else {
            content = obj.toString();
        }
       
    m_oCols.setProperty(m_sDataCol, content);
    JdbcCleanConn oConn = null;
    PreparedStatement ps = null;
    try
    {
      oConn = createJdbcCleanConnection();
      ps = oConn.prepareStatement(getInsertStmt());
      oConn.execUpdWait(ps, 3); // TODO the executeUpdate routine doesn't check return code, which could mask a problem https://jira.jboss.org/jira/browse/SOA-642                 
      // TODO the executeUpdate routine doesn't check return code, which could mask a problem https://jira.jboss.org/jira/browse/SOA-642
      oConn.commit();
    }
    catch( SQLException e)
    {
      final String errorMsg = "SqlException while trying to notify table. Insert statement : " + getInsertStmt();
      log.error( errorMsg , e );
      throw new NotificationException( errorMsg, e);
    }
    finally
    {
      if ( ps != null )
      {
        try
        {
          ps.close();
        }
        catch (SQLException e)
        {
          log.error( "SqlException while trying to close prepared statement PS", e );
        }
      }
      if (null != oConn)
      {
        oConn.release();
      }
    }
  } // __________________________________
View Full Code Here

  /*
   * extracted this method to simplify testing. DanielB
   */
  protected JdbcCleanConn createJdbcCleanConnection()
  {
    return new JdbcCleanConn(new SimpleDataSource(m_sDriver, m_sURL, m_sUser, m_sPwd));
  }
View Full Code Here

   
    gateway = new SqlTableGatewayListener(tree);
   
    try
    {
      JdbcCleanConn conn = gateway.getDbConn();
      gateway.prepareStatements();
    }
    catch (RuntimeException ex)
    {
      log.error(ex);
View Full Code Here

   
    gateway = new SqlTableGatewayListener(tree);
   
    try
    {
      JdbcCleanConn conn = gateway.getDbConn();
      gateway.prepareStatements();
    }
    catch (RuntimeException ex)
    {
      log.error(ex);
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.helpers.persist.JdbcCleanConn

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.