/** We may decide to implement this later but for now, every call to here returns null. */ @Override public PreparedStatement loadParameters(PreparedStatement ps, ReviewsBean bean) throws SQLException { int i = 1; ps.setLong(i++, bean.getMID()); ps.setLong(i++, bean.getPID()); ps.setString(i++, bean.getDescriptiveReview()); ps.setDouble(i++, bean.getRating()); ps.setString(i++, bean.getTitle()); return ps; }
/** * ReviewsBeans are built and returned, when possible from info in ResultSet. * * @param ResultSet from query, holds DB info for ReviewsBean * @return the loaded ReviewsBean */ @Override public ReviewsBean loadSingle(ResultSet rs) throws SQLException { ReviewsBean rev = new ReviewsBean(); rev.setMID(rs.getLong("mid")); rev.setPID(rs.getLong("pid")); rev.setDateOfReview(rs.getDate("reviewdate")); rev.setDescriptiveReview(rs.getString("descriptivereview")); rev.setRating(rs.getInt("rating")); rev.setTitle(rs.getString("title")); return rev; }