Package com.art.anette.exceptions

Examples of com.art.anette.exceptions.DatabaseException


    public void checkVersion() throws DatabaseException {
        try {
            ResultSet rs = query("SELECT Version FROM DBSchema where id=1");
            if (rs.next()) {
                if (!EXPECTED_DBSCHEMA_VERSION.equals(rs.getString("Version"))) {
                    throw new DatabaseException("Wrong version of DBSchema");
                }
            }
        } catch (SQLException e) {
            throw new DatabaseException(e.getMessage(), e);
        }
    }
View Full Code Here


            try {
                Class.forName(getDBClass()).newInstance();
                connection = DriverManager.getConnection(getDBUrl(), user, password);
            } catch (SQLException ex) {
                logger.severe(null, ex);
                throw new DatabaseException("Connecting to database failed!", ex);
            } catch (InstantiationException ex) {
                logger.severe(null, ex);
                throw new DatabaseException("Instantiation of the database driver failed!", ex);
            } catch (IllegalAccessException ex) {
                logger.severe(null, ex);
                throw new DatabaseException("Accessing the database driver failed!", ex);
            } catch (ClassNotFoundException ex) {
                logger.severe(null, ex);
                throw new DatabaseException("Database driver not found!", ex);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.art.anette.exceptions.DatabaseException

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.