Package cn.edu.zju.acm.onlinejudge.persistence

Examples of cn.edu.zju.acm.onlinejudge.persistence.PersistenceException


                }
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to update the QQs", e);
        } finally {
            Database.dispose(conn);
        }

    }
View Full Code Here


                return qqs;
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to get the QQs", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                return ret;
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to get the QQs", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                return submissions;
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to get queueing submissions", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

     */
    public static Connection createConnection() throws PersistenceException {
        try {
            return Database.ds.getConnection();
        } catch (SQLException e) {
            throw new PersistenceException("Failed to create connection", e);
        }
    }
View Full Code Here

     * @return the property value in string
     */
    private static String getStringProperty(Properties properties, String key) throws PersistenceException {
        String value = properties.getProperty(key);
        if (value == null) {
            throw new PersistenceException(key + " property is missing in " + Database.CONFIG_FILE);
        }
        return value;
    }
View Full Code Here

    private static int getIntegerProperty(Properties properties, String key) throws PersistenceException {
        String value = Database.getStringProperty(properties, key);
        try {
            return Integer.parseInt(value);
        } catch (NumberFormatException nfe) {
            throw new PersistenceException(key + " property is an invalid integer");
        }
    }
View Full Code Here

    private static long getLongProperty(Properties properties, String key) throws PersistenceException {
        String value = Database.getStringProperty(properties, key);
        try {
            return Long.parseLong(value);
        } catch (NumberFormatException nfe) {
            throw new PersistenceException(key + " property is an invalid long");
        }
    }
View Full Code Here

                    Database.dispose(ps);
                }
                ContestPersistenceImpl.defaultLimit = limit;
            }
        } catch (Exception e) {
            throw new PersistenceException("Failed to update the default limit", e);
        } finally {
            Database.dispose(conn);
        }

    }
View Full Code Here

                }
            }
            conn.commit();
        } catch (Exception e) {
            Database.rollback(conn);
            throw new PersistenceException("Failed to create contest.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

TOP

Related Classes of cn.edu.zju.acm.onlinejudge.persistence.PersistenceException

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.