public void update(Customer c){ Connection conn = null; PreparedStatement st = null; ResultSet rs = null; try{ conn = JdbcUtils.getConnection(); String sql = "update customer set name=?,gender=?,birthday=?,cellphone=?,email=?,preference=?,type=?,description=? where id=?"; st = conn.prepareStatement(sql); st.setString(1, c.getName()); st.setString(2, c.getGender()); st.setDate(3, new java.sql.Date(c.getBirthday().getTime())); st.setString(4, c.getCellphone()); st.setString(5, c.getEmail()); st.setString(6, c.getPreference()); st.setString(7, c.getType()); st.setString(8, c.getDescription()); st.setString(9, c.getId()); st.executeUpdate(); }catch (Exception e) { throw new DaoException(e); }finally{ JdbcUtils.release(conn, st, rs); }