Package nz.co.abrahams.asithappens.core

Examples of nz.co.abrahams.asithappens.core.DBException


            results.close();
            statement.close();
            return setDisplays;
        } catch (SQLException e) {
            logger.error("Problem retrieving SetDisplays from database");
            throw new DBException("Problem retrieving SetDisplays in database", e);
        }
       
    }
View Full Code Here


    public void closeConnection() throws DBException {
        try {
            connection.close();
        } catch (SQLException e) {
            logger.error("Error closing database connection for SetDisplayDAO");
            throw new DBException("Error closing database connection for SetDisplay DAO", e);
        }
    }
View Full Code Here

                statement.executeUpdate();
                statement.close();
            }
        } catch (SQLException e) {
            logger.error("Problem updating device information for " + name);
            throw new DBException("Problem updating device information for " + name, e);
        }
    }
View Full Code Here

            } else {
                return new Device(name, results.getString("communityRead"), results.getString("communityWrite"), useWrite, ipAddress, hardwareAddress);
            }
        } catch (SQLException e) {
            logger.error("Problem retrieving device information for " + name);
            throw new DBException("Problem retrieving device information for " + name, e);
        }
    }
View Full Code Here

            logger.error("Error code: " + e.getErrorCode());
            if ( e.getErrorCode() == EXCEPTION_NO_DATA )
                return false;
            else {
                logger.error("Problem checking for device " + name);
                throw new DBException("Problem checking for device " + name, e);
            }
        }
    }
View Full Code Here

    public void closeConnection() throws DBException {
        try {
            connection.close();
        } catch (SQLException e) {
            logger.error("Error closing database connection for DataLabelsDAO");
            throw new DBException("Error closing database connection for DataLabels DAO", e);
        }
    }
View Full Code Here

            statement.close();
            logger.debug("Adding new session with ID " + sessionID);
            return sessionID;
        } catch (SQLException e) {
            logger.error("Failed to add new session to database");
            throw new DBException("Failed to add new session to database", e);
        }
    }
View Full Code Here

            connection.setAutoCommit(true);
            statement.close();
            logger.debug("Adding new session with ID " + sessionID);
        } catch (SQLException e) {
            logger.error("Failed to delete session with ID " + sessionID + " from database");
            throw new DBException("Failed to delete session with ID " + sessionID + " from database", e);
        }
    }
View Full Code Here

            statement.setInt(5, dataSets.getSessionID());
            statement.executeUpdate();
            statement.close();
        } catch (SQLException e) {
            logger.error("Failed to update session with ID " + dataSets.getSessionID() + " in database");
            throw new DBException("Failed to update session with ID " + dataSets.getSessionID() + " in database", e);
        }
    }
View Full Code Here

            statement.setString(1, columnName);
            statement.setString(2, value);
            statement.setInt(3, sessionID);
            if (statement.executeUpdate() == 0) {
                logger.error("Cannot find session with ID " + sessionID + " to update " + columnName);
                throw new DBException("Cannot find session with ID " + sessionID + " to update " + columnName);
            }
            statement.close();
        } catch (SQLException e) {
            logger.error("Cannot update session with ID " + sessionID + " to update " + columnName);
            throw new DBException("Cannot update session with ID " + sessionID + " to update " + columnName, e);
        }
    }
View Full Code Here

TOP

Related Classes of nz.co.abrahams.asithappens.core.DBException

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.