public void update() {
        // update name
        this.jPatientName.setText("Welcome "+Session.getInstance().getPatientName());

        Object[] colNames = {"sid", "pid", "author_id", "policy"};
        Object[][] data = {
            {1, 1, "hello"}
        };
        jTable1.setModel(DatabaseClient.getInstance().retrieveSection());

        jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent event) {
                // do some actions here, for example
                // print first column value from selected row
//                System.out.println(jTable1.getValueAt(jTable1.getSelectedRow(), 0).toString());
                if (jTable1.getRowCount() < 1) {
                    return;
                }
//                if (jTable1.getValueAt(jTable1.getSelectedRow(), 0).toString().isEmpty()) {
//                    return;
//                }
                int sid=-1;
                try {
                    sid = (int) (jTable1.getValueAt(jTable1.getSelectedRow(), 0));
                } catch (NullPointerException npe) {
                    System.out.println("no rows found");
                    jDetails.setText("");
                    return;
                }catch(ArrayIndexOutOfBoundsException aiobe){
                    System.out.println("array index bound error");
                    return;
                }
                CipherKeyPair ckp = DatabaseClient.getInstance().getEncryptedRecordPair(sid);
//                System.out.println("aes key:" + ckp.getKey());
//                System.out.println("cipher_text:" + ckp.getCiphertext());

                Cpabe cpabe = new Cpabe();
                try {
                    System.out.println("private file:" + KeyConfig.getInstance().getUserReadSecretKeyPath());

                    byte[] decKey = cpabe.dec(KeyConfig.getInstance().getPatientReadPublicKeyPath(), KeyConfig.getInstance().getPatientReadSecretKeyPath(), ckp.getKeyBinary());
                    byte[] plainMsgBytes = AESCoder.decrypt(decKey, ckp.getCiphertextBinary());
                    jDetails.setText(new String(plainMsgBytes));

                } catch (IllegalAccessException ex) {
                    jDetails.setText("cannot decrypt, attributes in key do not satisfy policy");
                }catch(NegativeArraySizeException fnfe){
                    jDetails.setText("cannot read, you don't have read access");
                } catch(java.io.FileNotFoundException fnfe){
                    jDetails.setText("cannot read, you don't have read access");
                } catch (Exception ex) {
                    Logger.getLogger(UserHomePanel.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
//        jTable1.setModel(new DefaultTableModel(data, colNames));
    }