Package org.skife.jdbi.v2.exceptions

Examples of org.skife.jdbi.v2.exceptions.UnableToCreateStatementException


        final Handle h = this.open();
        try {
            return callback.withHandle(h);
        }
        catch (Exception e) {
            throw new CallbackFailedException(e);
        }
        finally {
            h.close();
        }
    }
View Full Code Here


        ResultSet rs;
        try {
            rs = this.stmt.getReturnResultSet();
        }
        catch (SQLException e) {
            throw new ResultSetException("Unable to retrieve return result set", e);
        }

        this.results = new ArrayList<ResultType>();
        try {
            int i = 0;
            while (rs.next()) {
                results.add(mapper.map(i++, rs, context));
            }
        }
        catch (SQLException e) {
            throw new ResultSetException("Unable to retrieve results from returned result set", e);
        }
    }
View Full Code Here

        try {
            hasNext = results.next();
        }
        catch (SQLException e) {
            throw new ResultSetException("Unable to advance result set", e);
        }
        if (!hasNext) {
            try {
                results.close();
            }
            catch (SQLException e) {
                throw new ResultSetException("Unable to close result set after iterating through to the end", e);
            }
        }
        alreadyAdvanced = true;
        return hasNext;
    }
View Full Code Here

                if (!results.next()) {
                    throw new IllegalStateException("No element to advance to");
                }
            }
            catch (SQLException e) {
                throw new ResultSetException("Unable to advance result set", e);
            }
        }
        alreadyAdvanced = false;
        try {
            return mapper.map(count++, results, context);
        }
        catch (SQLException e) {
            throw new ResultSetException("Error thrown mapping result set into return type", e);
        }
    }
View Full Code Here

        {
            m = r.getMetaData();
        }
        catch (SQLException e)
        {
            throw new ResultSetException("Unable to obtain metadata from result set", e);
        }

        try
        {
            for (int i = 0; i < m.getColumnCount(); i ++)
            {
                String key = m.getColumnName(i);
                String alias = m.getColumnLabel(i);
                Object value = r.getObject(i);
                row.put(alias != null ? alias : key, value);
            }
        }
        catch (SQLException e)
        {
            throw new ResultSetException("Unable to access specific metadata from " +
                                         "result set metadata", e);
        }
        return row;
    }
View Full Code Here

            try {
                rs = stmt.getResultSet();
                return munger.munge(stmt);
            }
            catch (SQLException e) {
                throw new ResultSetException("Exception thrown while attempting to traverse the result set", e);
            }
        }
        finally {
            cleanup.cleanup(this, null, rs);
        }
View Full Code Here

            boolean initial = handle.getConnection().getAutoCommit();
            localStuff.put(handle, new LocalStuff(initial));
            handle.getConnection().setAutoCommit(false);
        }
        catch (SQLException e) {
            throw new TransactionException("Failed to start transaction", e);
        }
    }
View Full Code Here

                handle.getConnection().setAutoCommit(stuff.getInitialAutocommit());
                stuff.getCheckpoints().clear();
            }
        }
        catch (SQLException e) {
            throw new TransactionException("Failed to commit transaction", e);
        }
        finally {
            // prevent memory leak if commit throws an exception
            if (localStuff.containsKey(handle)) {
                localStuff.remove(handle);
View Full Code Here

                handle.getConnection().setAutoCommit(stuff.getInitialAutocommit());
                stuff.getCheckpoints().clear();
            }
        }
        catch (SQLException e) {
            throw new TransactionException("Failed to rollback transaction", e);
        }
        finally {
            // prevent memory leak if rollback throws an exception
            if (localStuff.containsKey(handle)) {
                localStuff.remove(handle);
View Full Code Here

        try {
            final Savepoint savepoint = conn.setSavepoint(name);
            localStuff.get(handle).getCheckpoints().put(name, savepoint);
        }
        catch (SQLException e) {
            throw new TransactionException(String.format("Unable to create checkpoint %s", name), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.skife.jdbi.v2.exceptions.UnableToCreateStatementException

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.