private void ApplySingleVulnerabilityButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ApplySingleVulnerabilityButtonActionPerformed
    String[] VulnerabilityData = null;

    int count = 0;
    Connection conn = null;
    PreparedStatement ps = null;
    ResultSet rs = null;
    int VULNERABILITY_INJECTION_RESULTS_ID;

    // Adapted from http://developers.sun.com/docs/javadb/10.2.2/ref/rrefclob.html
    try {
        if ((conn = this.JavaDBAccess.setConn()) != null) {
            System.out.println("Connected to database " + this.JavaDBAccess.getDatabaseName());
        } else {
            throw new Exception("Not connected to database " + this.JavaDBAccess.getDatabaseName());
        }

        conn.setAutoCommit(false);

        // Test to see if the Target PHP file is already in the DB
        ps = conn.prepareStatement("SELECT VULNERABILITY_INJECTION_RESULTS.ID FROM VULNERABILITY_INJECTION_RESULTS,TARGET_PHP_FILES WHERE VULNERABILITY_INJECTION_RESULTS.TARGET_PHP_FILE=TARGET_PHP_FILES.ID AND TARGET_PHP_FILES.PATH=? AND VULNERABILITY_INJECTION_RESULTS.DIFF_TEXT=?"); // get the result

        ps.setString(1, TargetPHPFileSelectedComboBox.getSelectedItem().toString());
        ps.setString(2, VulnerabilitySelectedComboBox.getSelectedItem().toString());
        rs = ps.executeQuery(); // get the result

        rs.next();
        // Open matches log file.
        VULNERABILITY_INJECTION_RESULTS_ID = rs.getInt(1);
        rs.close();
        ps.close();
        conn.commit();

        // Test to see if the Target PHP file is already in the DB
        ps = conn.prepareStatement("SELECT COUNT(*) FROM ATTACK_PAYLOADS,PAYLOADS WHERE ATTACK_PAYLOADS.PAYLOAD=PAYLOADS.ID AND ATTACK_PAYLOADS.ATTACK_RESULT='SUCCESSFUL' AND ATTACK_PAYLOADS.VULNERABILITY_INJECTION_RESULT=?"); // get the result

        ps.setInt(1, VULNERABILITY_INJECTION_RESULTS_ID);
        rs = ps.executeQuery(); // get the result

        rs.next();
        count = rs.getInt(1);
        rs.close();
        ps.close();

        VulnerabilityData = new String[count + 1];
        VulnerabilityData[0] = "null";

        // Test to see if the Target PHP file is already in the DB
        ps = conn.prepareStatement("SELECT PAYLOADS.PAYLOAD FROM ATTACK_PAYLOADS,PAYLOADS WHERE ATTACK_PAYLOADS.PAYLOAD=PAYLOADS.ID AND ATTACK_PAYLOADS.ATTACK_RESULT='SUCCESSFUL' AND ATTACK_PAYLOADS.VULNERABILITY_INJECTION_RESULT=?"); // get the result

        ps.setInt(1, VULNERABILITY_INJECTION_RESULTS_ID);
        rs = ps.executeQuery(); // get the result

        while (rs.next()) {
            // Open matches log file.
            VulnerabilityData[rs.getRow()] = rs.getString(1);
        }
        rs.close();
        ps.close();
        conn.commit();
        conn.close();
        SuccessPayloadSelectedComboBox.setModel(new javax.swing.DefaultComboBoxModel(VulnerabilityData));

        //Apply the Vulnerable PHP File
        VulnInject.ApplyVulnerablePHPFile(JavaDBAccess, VULNERABILITY_INJECTION_RESULTS_ID);

    } catch (Throwable e) {
        System.out.println("exception thrown:");

        if (e instanceof SQLException) {
            JavaDBAccess.printSQLError((SQLException) e);
        } else {
            e.printStackTrace();
        }
    }
}