Package org.jooq.exception

Examples of org.jooq.exception.DataAccessException


        try {
            log.debug("setting tx isolation", level);
            connection.setTransactionIsolation(level);
        }
        catch (Exception e) {
            throw new DataAccessException("Cannot set transactionIsolation", e);
        }
    }
View Full Code Here


    public final int getTransactionIsolation() throws DataAccessException {
        try {
            return connection.getTransactionIsolation();
        }
        catch (Exception e) {
            throw new DataAccessException("Cannot get transactionIsolation", e);
        }
    }
View Full Code Here

            try {
                connection = provider.acquire();
                meta = connection.getMetaData();
            }
            catch (SQLException e) {
                throw new DataAccessException("Error while accessing DatabaseMetaData", e);
            }
            finally {
                if (connection != null) {
                    provider.release(connection);
                }
View Full Code Here

            }

            return result;
        }
        catch (SQLException e) {
            throw new DataAccessException("Error while accessing DatabaseMetaData", e);
        }
    }
View Full Code Here

                }

                return result;
            }
            catch (SQLException e) {
                throw new DataAccessException("Error while accessing DatabaseMetaData", e);
            }
        }
View Full Code Here

                }

                return result;
            }
            catch (SQLException e) {
                throw new DataAccessException("Error while accessing DatabaseMetaData", e);
            }
        }
View Full Code Here

                // Sort by KEY_SEQ
                result.sortAsc(4);
                return createPrimaryKey(result, 3);
            }
            catch (SQLException e) {
                throw new DataAccessException("Error while accessing DatabaseMetaData", e);
            }
        }
View Full Code Here

    }

    @SuppressWarnings("deprecation")
    private Factory getDelegate() {
        if (dataSource == null || dialect == null) {
            throw new DataAccessException("Both dataSource and dialect properties should be set");
        }
        try {
            Class<? extends Factory> clazz = getDialect().getFactory();
            Connection con = getDataSource().getConnection();

            Constructor<? extends Factory> constructor;
            if (schemaMapping == null) {
                constructor = clazz.getConstructor(Connection.class);
                return constructor.newInstance(con);
            }
            else {
                constructor = clazz.getConstructor(Connection.class, org.jooq.SchemaMapping.class);
                return constructor.newInstance(con, schemaMapping);
            }
        }
        catch (Exception e) {
            throw new DataAccessException("Failed to create jOOQ Factory", e);
        }
    }
View Full Code Here

        return result;
    }

    private final DataAccessException onKeyException() {
        return new DataAccessException("Key ambiguous between tables " + lhs + " and " + rhs);
    }
View Full Code Here

    /**
     * Translate a {@link SQLException} to a {@link DataAccessException}
     */
    static final DataAccessException translate(String task, String sql, SQLException e) {
        String message = task + "; SQL [" + sql + "]; " + e.getMessage();
        return new DataAccessException(message, e);
    }
View Full Code Here

TOP

Related Classes of org.jooq.exception.DataAccessException

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.