public boolean updatePackage(FreeTrial ft) { boolean ok = false; try { String sql = "UPDATE free_trial SET days=?,download_count=? WHERE id=?"; PreparedStatement ps = DBFactory.getConnection().prepareStatement(sql); ps.setInt(1, ft.getDays()); ps.setInt(2, ft.getDownload_count()); ps.setInt(3, ft.getFreeId()); int i = ps.executeUpdate(); if (i > 0) { ok = true; } } catch (Exception e) { e.printStackTrace(); } return ok; }