public static Event create(Connection connection, Event event) {
        PreparedStatement preparedstatement = null;
        try {
            Calendar calendar = Calendar.getInstance();
            calendar.set(1900, 0, 1);

            preparedstatement = connection.prepareStatement("insert into civicrm_event values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");

            preparedstatement.setString(1, event.getTitle());
            preparedstatement.setString(2, event.getSummary());
            preparedstatement.setString(3, event.getDescription());
            preparedstatement.setInt(4, event.getEvent_type_id());
            preparedstatement.setInt(5, event.getParticipant_listing_id());
            preparedstatement.setBoolean(6, event.isIs_public());
            if (event.getStart_date() == null) {
                java.sql.Date startdatedefault = null;
                preparedstatement.setDate(7, startdatedefault);
            } else {
                java.sql.Date startdate = new java.sql.Date(event.getStart_date().getTime());
                preparedstatement.setDate(7, startdate);
            }
            if (event.getEnd_date() == null) {
                java.sql.Date enddatedefault = null;
                preparedstatement.setDate(8, enddatedefault);
            } else {
                java.sql.Date enddate = new java.sql.Date(event.getEnd_date().getTime());
                preparedstatement.setDate(8, enddate);
            }
            preparedstatement.setBoolean(9, event.isIs_online_registration());
            preparedstatement.setString(10, event.getRegistration_link_text());
            if (event.getRegistration_start_date() == null) {
                java.sql.Date registrationstartdatedefault = null;
                preparedstatement.setDate(11, registrationstartdatedefault);
            } else {
                java.sql.Date registrationstartdate = new java.sql.Date(event.getRegistration_start_date().getTime());
                preparedstatement.setDate(11, registrationstartdate);
            }
            if (event.getRegistration_end_date() == null) {
                java.sql.Date registrationenddatedefault = null;
                preparedstatement.setDate(12, registrationenddatedefault);
            } else {
                java.sql.Date registrationenddate = new java.sql.Date(event.getRegistration_end_date().getTime());
                preparedstatement.setDate(12, registrationenddate);
            }
            preparedstatement.setInt(13, event.getMax_participants());
            preparedstatement.setString(14, event.getEvent_full_text());
            preparedstatement.setBoolean(15, event.isIs_monetary());
            preparedstatement.setInt(16, event.getContribution_type_id());
            preparedstatement.setString(17, event.getPayment_processor());
            preparedstatement.setBoolean(18, event.isIs_map());
            preparedstatement.setBoolean(19, event.isIs_active());
            preparedstatement.setString(20, event.getFee_label());
            preparedstatement.setBoolean(21, event.isIs_show_location());
            preparedstatement.setInt(22, event.getLoc_block_id());
            preparedstatement.setInt(23, event.getDefault_role_id());
            preparedstatement.setString(24, event.getIntro_text());
            preparedstatement.setString(25, event.getFooter_text());
            preparedstatement.setString(26, event.getConfirm_title());
            preparedstatement.setString(27, event.getConfirm_text());
            preparedstatement.setString(28, event.getConfirm_footer_text());
            preparedstatement.setBoolean(29, event.isIs_email_confirm());
            preparedstatement.setString(30, event.getConfirm_email_text());
            preparedstatement.setString(31, event.getConfirm_from_name());
            preparedstatement.setString(32, event.getConfirm_from_email());

            preparedstatement.setString(33, event.getCc_confirm());
            preparedstatement.setString(34, event.getBcc_confirm());
            preparedstatement.setInt(35, event.getDefault_fee_id());
            preparedstatement.setInt(36, event.getDefault_discount_fee_id());
            preparedstatement.setString(37, event.getThankyou_title());
            preparedstatement.setString(38, event.getThankyou_text());
            preparedstatement.setString(39, event.getThankyou_footer_text());
            preparedstatement.setBoolean(40, event.isIs_pay_later());
            preparedstatement.setString(41, event.getPay_later_text());
            preparedstatement.setString(42, event.getPay_later_receipt());
            preparedstatement.setBoolean(43, event.isIs_multiple_registrations());
            preparedstatement.setBoolean(44, event.isAllow_same_participant_emails());
            preparedstatement.setBoolean(45, event.isHas_waitlist());
            preparedstatement.setBoolean(46, event.isRequires_approval());
            preparedstatement.setInt(47, event.getExpiration_time());
            preparedstatement.setString(48, event.getWaitlist_text());
            preparedstatement.setString(49, event.getApproval_req_text());
            preparedstatement.setBoolean(50, event.isIs_template());
            preparedstatement.setString(51, event.getTemplate_title());
            preparedstatement.setInt(52, event.getCreated_id());
            if (event.getCreated_date() == null) {
                java.sql.Date createddatedefault = null;
                preparedstatement.setDate(53, createddatedefault);
            } else {
                java.sql.Date createddate = new java.sql.Date(event.getCreated_date().getTime());
                preparedstatement.setDate(53, createddate);
            }
            preparedstatement.setString(54, event.getCurrency());
            preparedstatement.setInt(55, event.getCampaign_id());
            preparedstatement.setBoolean(56, event.isIs_share());
            preparedstatement.setInt(57, event.getParent_event_id());
            preparedstatement.setInt(58, event.getSlot_label_id());

            preparedstatement.setString(57, event.getThankyou_text());
            preparedstatement.setString(58, event.getThankyou_text());

            int id = Controller.lastInsertId(connection);
            event.setId(id);
            return event;
        } catch (SQLException ex) {
            Logger.getLogger(EventController.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } finally {
            try {
                if (!preparedstatement.isClosed()) {
                    preparedstatement.close();
                }
            } catch (SQLException ex) {
                Logger.getLogger(AddressController.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }