Example #1
0
  @Override
  protected List<Branch> processResult(ResultSet rs) throws SQLException {
    List<Branch> aList = new ArrayList<Branch>();
    while (rs.next()) {
      Branch a = new Branch();
      a.setBranchId(rs.getInt("branchId"));
      a.setBranchName(rs.getString("branchName"));
      a.setBranchAddress(rs.getString("branchAddress"));

      aList.add(a);
    }

    return aList;
  }
Example #2
0
 public void update(Branch b) throws SQLException {
   save(
       "update tbl_library_branch set branchName = ?,branchAddress=? where branchId = ?",
       new Object[] {b.getBranchName(), b.getBranchAddress(), b.getBranchId()});
 }
Example #3
0
 public void delete(Branch b) throws SQLException {
   save("delete from tbl_library_branch where branchId = ?", new Object[] {b.getBranchId()});
 }
Example #4
0
 public void create(Branch b) throws SQLException {
   save(
       "insert into tbl_library_branch (branchName,branchAddress) values (?)",
       new Object[] {b.getBranchName(), b.getBranchAddress()});
 }