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

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


                    Database.dispose(ps);
                }
                this.allLanguages.put(language.getId(), language);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to create language.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here


                    ps.setString(4, language.getCompiler());
                    ps.setLong(5, user);
                    ps.setTimestamp(6, new Timestamp(new Date().getTime()));
                    ps.setLong(7, language.getId());
                    if (ps.executeUpdate() == 0) {
                        throw new PersistenceException("no such language");
                    }
                } finally {
                    Database.dispose(ps);
                }
                this.allLanguages.put(language.getId(), language);
            }
        } catch (PersistenceException pe) {
            throw pe;
        } catch (Exception e) {
            throw new PersistenceException("Failed to update language.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                conn.commit();
                this.allLanguages.remove(id);
            }
        } catch (Exception e) {
            Database.rollback(conn);
            throw new PersistenceException("Failed to delete language.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                Database.dispose(ps);
            }
            conn.commit();
        } catch (Exception e) {
            Database.rollback(conn);
            throw new PersistenceException("Failed to create problem reference.", e);
        } finally {
            Database.dispose(conn);
        }

    }
View Full Code Here

                ps.executeUpdate();
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to create problem.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                Database.dispose(ps);
            }
            conn.commit();
        } catch (Exception e) {
            Database.rollback(conn);
            throw new PersistenceException("Failed to create problem.", e);
        } finally {
            Database.dispose(conn);
        }

    }
View Full Code Here

                return this.populateReference(rs);
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to get the reference with id " + id, e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

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

                return references;
            } finally {
                Database.dispose(ps);
            }
        } catch (Exception e) {
            throw new PersistenceException("Failed to get the reference info", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

            }
            submission.setId(Database.getLastId(conn));
            conn.commit();
        } catch (Exception e) {
            Database.rollback(conn);
            throw new PersistenceException("Failed to insert submission.", 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.