private void deleteBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteBtnActionPerformed
        try {

            connectDb();
            int selectedRow = questionTable.getSelectedRow();
            rowID = (questionTable.getModel().getValueAt(selectedRow, 1).toString());

            int errors = 0;

            String deleteAnswer = "DELETE FROM fibanswer WHERE QuestionID='" + rowID + "'";
            int rows2 = st.executeUpdate(deleteAnswer);
            if (rows2 == 0) {
                errors++;
            }

            String deleteQuestion = "DELETE FROM fib WHERE QuestionID='" + rowID + "'";
            int rows1 = st.executeUpdate(deleteQuestion);
            if (rows1 == 0) {
                errors++;
            }

            if (errors == 0) {
                JOptionPane.showMessageDialog(null, "Question was successfully deleted!");
                refresh();
            } else {
                JOptionPane.showMessageDialog(null, "ERROR : Delete was not successfull!");
                refresh();
            }

        } catch (Exception exc) {
            exc.printStackTrace();
        }
    }//GEN-LAST:event_deleteBtnActionPerformed