Package nz.co.abrahams.asithappens.core

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


            statement = connection.prepareStatement(UPDATE_SESSION_TITLE);
            statement.setString(1, title);
            statement.setInt(2, sessionID);
            if (statement.executeUpdate() == 0) {
                logger.error("Cannot find session with ID " + sessionID + " to update title");
                throw new DBException("Cannot find session with ID " + sessionID + " to update title");
            }
            statement.close();
            logger.debug("Updating title for session with ID " + sessionID + " to " + "'" + title + "'");
        } catch (SQLException e) {
            logger.error("Cannot update session with ID " + sessionID + " to update title");
            throw new DBException("Cannot update session with ID " + sessionID + " to update title", e);
        }
    }
View Full Code Here


            statement = connection.prepareStatement(UPDATE_SESSION_STARTTIME);
            statement.setLong(1, time);
            statement.setInt(2, sessionID);
            if (statement.executeUpdate() == 0) {
                logger.error("Cannot find session with ID " + sessionID + " to update start time");
                throw new DBException("Cannot find session with ID " + sessionID + " to update start time");
            }
            statement.close();
            logger.debug("Updating start time for session with ID " + sessionID + " to " + "'" + time + "'");
        } catch (SQLException e) {
            logger.error("Cannot update session with ID " + sessionID + " to update start time");
            throw new DBException("Cannot update session with ID " + sessionID + " to update start time", e);
        }
    }
View Full Code Here

            statement = connection.prepareStatement(UPDATE_SESSION_FINISHTIME);
            statement.setLong(1, time);
            statement.setInt(2, sessionID);
            if (statement.executeUpdate() == 0) {
                logger.error("Cannot find session with ID " + sessionID + " to update finish time");
                throw new DBException("Cannot find session with ID " + sessionID + " to update finish time");
            }
            statement.close();
            logger.debug("Updating finish time for session with ID " + sessionID + " to " + "'" + time + "'");
        } catch (SQLException e) {
            logger.error("Cannot update session with ID " + sessionID + " to update finish time");
            throw new DBException("Cannot update session with ID " + sessionID + " to update finish time", e);
        }
    }
View Full Code Here

            statement = connection.prepareStatement(UPDATE_SESSION_COLLECTING);
            statement.setInt(1, state ? 1 : 0);
            statement.setInt(2, sessionID);
            if (statement.executeUpdate() == 0) {
                logger.error("Cannot find session with ID " + sessionID + " to update collecting state");
                throw new DBException("Cannot find session with ID " + sessionID + " to update collecting state");
            }
            statement.close();
            logger.debug("Updating collecting state for session with ID " + sessionID + " to " + "'" + state + "'");
        } catch (SQLException e) {
            logger.error("Cannot update session with ID " + sessionID + " to update collecting state");
            throw new DBException("Cannot update session with ID " + sessionID + " to update collecting state", e);
        }
    }
View Full Code Here

            statement.close();
            logger.debug("Retrieving list of session IDs");
            return sessions;
        } catch (SQLException e) {
            logger.error("Cannot retrieve session ID list from database");
            throw new DBException("Cannot retrieve session ID list from database", e);
        }
    }
View Full Code Here

            result.close();
            statement.close();
            return values;
        } catch (SQLException e) {
            logger.error("Problem counting values for session " + sessionID + " set " + set);
            throw new DBException("Problem counting values for session " + sessionID + " set " + set, e);
        }
    }
View Full Code Here

            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

            }
           
            return data;
        } catch (SQLException e) {
            logger.error("Problem loading session template with ID: " + sessionID);
            throw new DBException("Problem loading session template with ID: " + sessionID);
        }
    }
View Full Code Here

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

            statement.setLong(3, collector.getPollInterval());
            statement.execute();
            statement.close();
        } catch (SQLException e) {
            logger.error("Problem creating BandwidthCollector in database for session " + sessionID);
            throw new DBException("Problem creating BandwidthCollector in database for session " + sessionID, 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.