Package org.openbravo.exception

Examples of org.openbravo.exception.PoolNotFoundException


      } else {
        myPool = ConnectionProviderContextListener.getPool(config.getServletContext());
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw new PoolNotFoundException(e.getMessage());
    }
  }
View Full Code Here


      } else {
        return new ConnectionProviderImpl(strPoolFile, isRelative, configParameters.strContext);
      }

    } catch (Exception ex) {
      throw new PoolNotFoundException(ex.getMessage());
    }
  }
View Full Code Here

    try {
      addNewPool(dbDriver, dbServer, dbLogin, dbPassword, minConns, maxConns, maxConnTime,
          dbSessionConfig, rdbms, poolName);
    } catch (Exception e) {
      log4j.error(e);
      throw new PoolNotFoundException("Failed when creating database connections pool", e);
    }
  }
View Full Code Here

    }
  }

  public ObjectPool getPool(String poolName) throws PoolNotFoundException {
    if (poolName == null || poolName.equals(""))
      throw new PoolNotFoundException("CouldnĀ“t get an unnamed pool");
    ObjectPool connectionPool = null;
    try {
      PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");
      connectionPool = driver.getConnectionPool(contextName + "_" + poolName);
    } catch (SQLException ex) {
      log4j.error(ex);
    }
    if (connectionPool == null)
      throw new PoolNotFoundException(poolName + " not found");
    else
      return connectionPool;
  }
View Full Code Here

  }

  public PreparedStatement getPreparedStatement(String poolName, String SQLPreparedStatement)
      throws Exception {
    if (poolName == null || poolName.equals(""))
      throw new PoolNotFoundException("Can't get the pool. No pool name specified");
    if (log4j.isDebugEnabled())
      log4j.debug("connection requested");
    Connection conn = getConnection(poolName);
    if (log4j.isDebugEnabled())
      log4j.debug("connection established");
View Full Code Here

  }

  public CallableStatement getCallableStatement(String poolName, String SQLCallableStatement)
      throws Exception {
    if (poolName == null || poolName.equals(""))
      throw new PoolNotFoundException("Can't get the pool. No pool name specified");
    Connection conn = getConnection(poolName);
    return getCallableStatement(conn, SQLCallableStatement);
  }
View Full Code Here

    return getStatement(defaultPoolName);
  }

  public Statement getStatement(String poolName) throws Exception {
    if (poolName == null || poolName.equals(""))
      throw new PoolNotFoundException("Can't get the pool. No pool name specified");
    Connection conn = getConnection(poolName);
    return getStatement(conn);
  }
View Full Code Here

      }
      log4j.debug("Created JNDI ConnectionProvider");

    } catch (Exception e) {
      log4j.error(e);
      throw new PoolNotFoundException("Failed when creating database connections pool: "
          + e.getMessage());
    }

  }
View Full Code Here

  }

  public PreparedStatement getPreparedStatement(String poolName, String SQLPreparedStatement)
      throws Exception {
    if (poolName == null || poolName.equals(""))
      throw new PoolNotFoundException("Can't get the pool. No pool name specified");
    if (log4j.isDebugEnabled())
      log4j.debug("connection requested");
    Connection conn = getConnection(poolName);
    if (log4j.isDebugEnabled())
      log4j.debug("connection established");
View Full Code Here

  }

  public CallableStatement getCallableStatement(String poolName, String SQLCallableStatement)
      throws Exception {
    if (poolName == null || poolName.equals(""))
      throw new PoolNotFoundException("Can't get the pool. No pool name specified");
    Connection conn = getConnection(poolName);
    return getCallableStatement(conn, SQLCallableStatement);
  }
View Full Code Here

TOP

Related Classes of org.openbravo.exception.PoolNotFoundException

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.