Package in.partake.model.dao

Examples of in.partake.model.dao.DAOException


            ps.setObject(1, id, Types.OTHER);

            rs = ps.executeQuery();
            return rs.next();
        } catch (SQLException e) {
            throw new DAOException(e);
        } finally {
            close(rs);
            close(ps);
        }
    }
View Full Code Here


                return new Postgres9Entity(id, version, body, opt, updatedAt != null ? new DateTime(updatedAt.getTime()) : null);
            } else {
                return null;
            }
        } catch (SQLException e) {
            throw new DAOException(e);
        } finally {
            close(rs);
            close(ps);
        }
    }
View Full Code Here

            ps = con.prepareStatement("DELETE FROM " + tableName + " WHERE id = ?");
            ps.setObject(1, id, Types.OTHER);

            ps.execute();
        } catch (SQLException e) {
            throw new DAOException(e);
        } finally {
            close(ps);
        }
    }
View Full Code Here

        try {
            ps = con.prepareStatement(sql);
            rs = ps.executeQuery();
            shouldClose = false;
        } catch (SQLException e) {
            throw new DAOException(e);
        } finally {
            if (shouldClose) {
                close(rs);
                close(ps);
                return null;
            }
        }

        DataMapper<ResultSet, Postgres9Entity> mapper = new DataMapper<ResultSet, Postgres9Entity>() {
            @Override
            public Postgres9Entity map(ResultSet rs) throws DAOException {
                try {
                    String id = rs.getString(1);
                    int version = rs.getInt(2);
                    byte[] body = rs.getBytes(3);
                    byte[] opt = rs.getBytes(4);
                    Timestamp updatedAt = rs.getTimestamp(5);
                    return new Postgres9Entity(id, version, body, opt, updatedAt != null ? new DateTime(updatedAt.getTime()) : null);
                } catch (SQLException e) {
                    throw new DAOException(e);
                }
            }

            @Override
            public ResultSet unmap(Postgres9Entity t) throws DAOException {
View Full Code Here

            if (rs.next())
                return rs.getInt(1);
            else
                return 0;
        } catch (SQLException e) {
            throw new DAOException(e);
        } finally {
            close(rs);
            close(ps);
        }
    }
View Full Code Here

        try {
            Connection con = dataSource.getConnection();
            con.setAutoCommit(false);
            return new Postgres9Connection(name, con, this, now);
        } catch (SQLException e) {
            throw new DAOException(e);
        }
    }
View Full Code Here

                    continue;

                remove(con, UUID.fromString(id));
            }
        } catch (SQLException e) {
            throw new DAOException(e);
        } finally {
            psars.close();
        }
    }
View Full Code Here

TOP

Related Classes of in.partake.model.dao.DAOException

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.