Examples of SQLNestedException


Examples of org.apache.commons.dbcp.SQLNestedException

        if (pool == null) {
            try {
                registerPool(username, password);
                pool = pools.get(key);
            } catch (NamingException e) {
                throw new SQLNestedException("RegisterPool failed", e);
            }
        }

        PooledConnectionAndInfo info = null;
        try {
            info = (PooledConnectionAndInfo)((ObjectPool) pool).borrowObject();
        }
        catch (Exception e) {
            throw new SQLNestedException(
                "Could not retrieve connection info from pool", e);
        }
       
        return info;
    }
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException

                }
            }
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new SQLNestedException("Cannot close connection (return to pool failed)", e);
        } finally {
            try {
                connection.close();
            } finally {
                connection = null;
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException

                return (PreparedStatement)
                        pstmtPool.borrowObject(createKey(sql));
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
            }
        }
    }
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException

                return (PreparedStatement) pstmtPool.borrowObject(
                    createKey(sql,resultSetType,resultSetConcurrency));
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
            }
        }
    }
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException

                return (PreparedStatement) pstmtPool.borrowObject(
                    createKey(sql,autoGeneratedKeys));
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
            }
        }
    }
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException

                    createKey(sql, resultSetType, resultSetConcurrency,
                            resultSetHoldability));
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
            }
        }
    }
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException

                return (PreparedStatement) pstmtPool.borrowObject(
                    createKey(sql, columnIndexes));
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
            }
        }
    }
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException

                return (PreparedStatement) pstmtPool.borrowObject(
                    createKey(sql, columnNames));
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
            }
        }
    }
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException

            if (manager == null) {
                try {
                    registerPool(username, password);
                    manager = (PooledConnectionManager) managers.get(key);
                } catch (NamingException e) {
                    throw new SQLNestedException("RegisterPool failed", e);
                }
            }
            pool = ((CPDSConnectionFactory) manager).getPool();
        }

        PooledConnectionAndInfo info = null;
        try {
            info = (PooledConnectionAndInfo) pool.borrowObject();
        }
        catch (NoSuchElementException ex) {
            throw new SQLNestedException(
                    "Could not retrieve connection info from pool", ex);
        }
        catch (Exception e) {
            // See if failure is due to CPDSConnectionFactory authentication failure
            try {
                testCPDS(username, password);
            } catch (Exception ex) {
                throw (SQLException) new SQLException(
                        "Could not retrieve connection info from pool").initCause(ex);
            }
            // New password works, so kill the old pool, create a new one, and borrow
            manager.closePool(username);
            synchronized (this) {
                managers.remove(key);
            }
            try {
                registerPool(username, password);
                pool = getPool(key);
            } catch (NamingException ne) {
                throw new SQLNestedException("RegisterPool failed", ne);
            }
            try {
                info = (PooledConnectionAndInfo)pool.borrowObject();
            } catch (Exception ex) {
                throw (SQLException) new SQLException(
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException

        synchronized(this) {
            if (pool == null) {
                try {
                    registerPool(username, password);
                } catch (NamingException e) {
                    throw new SQLNestedException("RegisterPool failed", e);
                }
            }
        }

        PooledConnectionAndInfo info = null;
       
        UserPassKey key = new UserPassKey(username, password);
       
        try {
            info = (PooledConnectionAndInfo) pool.borrowObject(key);
        }
        catch (Exception e) {
            throw new SQLNestedException(
                    "Could not retrieve connection info from pool", e);
        }
        return info;
    }
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.