@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; }
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()}); }
public void delete(Branch b) throws SQLException { save("delete from tbl_library_branch where branchId = ?", new Object[] {b.getBranchId()}); }
public void create(Branch b) throws SQLException { save( "insert into tbl_library_branch (branchName,branchAddress) values (?)", new Object[] {b.getBranchName(), b.getBranchAddress()}); }