@Override public void update(Bank bank) { PreparedStatement pr; try { pr = con.prepareStatement("update tbl_Bank " + "set Name = ? " + "where id = ?"); pr.setString(1, bank.getName()); pr.setInt(2, bank.getId()); pr.execute(); pr.close(); } catch (SQLException e) { e.printStackTrace(); } }
@Override public void insert(Bank bank) { PreparedStatement pr; try { pr = con.prepareStatement("insert into tbl_Bank " + "(Name) values (?)"); pr.setString(1, bank.getName()); pr.execute(); pr.close(); } catch (SQLException e) { e.printStackTrace(); } }
@Override public void delete(Bank bank) { PreparedStatement pr; try { pr = con.prepareStatement("delete from tbl_Client where id = ?"); pr.setInt(1, bank.getId()); pr.execute(); pr.close(); } catch (SQLException e) { e.printStackTrace(); } }