Package org.openbravo.exception

Examples of org.openbravo.exception.NoConnectionAvailableException


  }

  public Connection getTransactionConnection() throws NoConnectionAvailableException, SQLException {
    Connection conn = getConnection();
    if (conn == null)
      throw new NoConnectionAvailableException("Couldn´t get an available connection");
    conn.setAutoCommit(false);
    return conn;
  }
View Full Code Here


  }

  public Connection getTransactionConnection() throws NoConnectionAvailableException, SQLException {
    Connection conn = getConnection();
    if (conn == null)
      throw new NoConnectionAvailableException("Couldn´t get an available connection");
    conn.setAutoCommit(false);
    return conn;
  }
View Full Code Here

    return getConnection(defaultPoolName);
  }

  public Connection getConnection(String poolName) throws NoConnectionAvailableException {
    if (poolName == null || poolName.equals(""))
      throw new NoConnectionAvailableException("Couldn´t get a connection for an unnamed pool");
    Connection conn = null;
    try {
      conn = DriverManager
          .getConnection("jdbc:apache:commons:dbcp:" + contextName + "_" + poolName);
    } catch (SQLException ex) {
      log4j.error(ex);
      throw new NoConnectionAvailableException(
          "There are no connections available in jdbc:apache:commons:dbcp:" + contextName + "_"
              + poolName);
    }
    return conn;
  }
View Full Code Here

  }

  public Connection getTransactionConnection() throws NoConnectionAvailableException, SQLException {
    Connection conn = getConnection();
    if (conn == null)
      throw new NoConnectionAvailableException("Couldn´t get an available connection");
    conn.setAutoCommit(false);
    return conn;
  }
View Full Code Here

  public Connection getConnection(String poolName) throws NoConnectionAvailableException {
    try {
      return pools.get(poolName).ds.getConnection();
    } catch (SQLException e) {
      throw new NoConnectionAvailableException(e.getMessage());
    }
  }
View Full Code Here

  }

  public Connection getTransactionConnection() throws NoConnectionAvailableException, SQLException {
    Connection conn = getConnection();
    if (conn == null) {
      throw new NoConnectionAvailableException("Couldn´t get an available connection");
    }
    conn.setAutoCommit(false);
    return conn;
  }
View Full Code Here

TOP

Related Classes of org.openbravo.exception.NoConnectionAvailableException

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.