title: Cannot fix the null 'key' argument to get graph to generate
body: <p>I have a graph that will display a comparison between quotes and invoices linked to an employee number within a certain time period. When I run the application, I get this infamous error message:</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Null 'key' argument.
        at org.jfree.chart.util.ParamChecks.nullNotPermitted(ParamChecks.java:65)
        at org.jfree.data.DefaultKeyedValues.setValue(DefaultKeyedValues.java:234)
        at org.jfree.data.DefaultKeyedValues2D.setValue(DefaultKeyedValues2D.java:341)
        at org.jfree.data.category.DefaultCategoryDataset.setValue(DefaultCategoryDataset.java:262)
        at org.jfree.data.category.DefaultCategoryDataset.setValue(DefaultCategoryDataset.java:278)
        at SV_ManagerDivision.SV_ManagerEmpPerformance.monthGraph(SV_ManagerEmpPerformance.java:577)
        at SV_ManagerDivision.SV_ManagerEmpPerformance.btnViewQIActionPerformed(SV_ManagerEmpPerformance.java:303)
        at SV_ManagerDivision.SV_ManagerEmpPerformance.access$200(SV_ManagerEmpPerformance.java:24)
        at SV_ManagerDivision.SV_ManagerEmpPerformance$3.actionPerformed(SV_ManagerEmpPerformance.java:159)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)</p>
  </blockquote>
  
  <p>I have tried everything to fix it, even this Stack Overflow question: <a href="https://stackoverflow.com/questions/3447108/null-key-argument-error">Null 'key' argument</a>, but it did not help me solve the problem.</p>
  
  <p>The coding for this graph to generate is:</p>
  
  <pre><code>PreparedStatement stmt = con.prepareStatement("select username, count(invoice_number) as invoiceCount, invoice_date from invoicedb where username = '" + empno + "' "
                      + "and extract(month from invoice_date) = '" + text + "' and extract(year from invoice_date) = '" + year + "'");
              ResultSet rs = stmt.executeQuery();
              DefaultCategoryDataset ddataset = new DefaultCategoryDataset();
              while (rs.next()) {
                  ddataset.setValue(rs.getInt("invoiceCount"),
                         "invoiceCount",
                         rs.getString("username"));
              }
              stmt = con.prepareStatement("select username, count(quote_number) as quoteCount, quote_date from quotedb where username = '" + empno + "' and extract(month from quote_date) = '" + text + "'"
                      + " and extract(year from quote_date) = '"+ year +"'");
              rs = stmt.executeQuery();
              while (rs.next()) {
                  ddataset.setValue(rs.getInt("quoteCount"),
                         "quoteCount",
                         rs.getString("username"));
              }
  </code></pre>
  
  <p>The error appears to lie on this line:</p>
  
  <pre><code>ddataset.setValue(rs.getInt("invoiceCount"),
  </code></pre>
  
  <p>Am I doing something wrong or is there another way to fix this error?</p>