Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
724 B
1
Indexable
Never
public boolean addChildrenInformation(String name, Date dob, boolean gender, String relationship ) {
        try {
            String sql = "insert into ChildrenInformation values (?,?,?,?,?)";
            PreparedStatement stm = connection.prepareStatement(sql);
            stm.setString(1, name);
            stm.setDate(2, new java.sql.Date(dob.getTime()));
            stm.setBoolean(3, gender);
            stm.setInt(4, getLastReservation());
            stm.setString(5, relationship);
            stm.execute();
            return true;
        } catch (SQLException ex) {
            Logger.getLogger(ReservationDao.class.getName()).log(Level.SEVERE, null, ex);
        }
        return false;
    }