public void updateEvent() {
        if (id != null) {
            PreparedStatement st = null;
            String q = "UPDATE events SET name = ?, location = ?, start_date = ?, end_date = ? WHERE id = ?";

            try {
                java.sql.Date sd = null;
                java.sql.Date ed = null;
                if (this.startDate != null) {
                    sd = new java.sql.Date(StringUtil.stringToDate(startDate).getTime());
                }
                if (this.endDate != null) {
                    ed = new java.sql.Date(StringUtil.stringToDate(endDate).getTime());
                }
                conn = dbconn.getConnection();
                st = conn.prepareStatement(q);
                st.setString(1, this.name);
                st.setString(2, this.location);
                st.setDate(3, sd);
                st.setDate(4, ed);
                st.setInt(5, this.id.intValue());
                st.executeUpdate();
            } catch (SQLException e) {
                e.printStackTrace();
            } finally {
                try {
                    conn.close();
                    st.close();
                } catch (SQLException e) {
                    System.out.println("Unable to close connection");
                }
            }
        } else {
            System.out.println("Unable to update event because id is null");
        }
    }