title: How to fix SQLException in the Catch Statement?
body: <p>This program is about auto complete. When I type something to the <code>textfield</code>, a list of suggestions will appear.</p>
  
  <p>I make the method <code>onWordUpdated()</code> for a list of suggestions from the DB when I type something to the <code>textfield</code>.</p>
  
  <p>Now, the problem is I have this error:</p>
  
  <pre><code>exception java.sql.SQLException is never thrown in body of corresponding try statement
  </code></pre>
  
  <p>I made a comment in the code so that you will know which line.</p>
  
  <p>Could someone help me how to fix this?</p>
  
  <p>thanks..</p>
  
  <p>I have this code:</p>
  
  <pre><code>public void onWordUpdated(final String toComplete)
    {
      new Thread(new Runnable()
      {
        public void run()
        {
          try
          {
            final List&lt;Suggestion&gt; suggestions = suggestor.getSuggestions(toComplete);
            SwingUtilities.invokeLater(new Runnable()
            {
              public void run()
              {
                try
                {
                  suggestionWidgetModel.clear();
                  for (Suggestion suggestion : suggestions)
                    suggestionWidgetModel.addElement(suggestion.getCaption());
                  if (!suggestions.isEmpty())
                    suggestionWidget.setSelectedIndex(0);
                }
                catch (SQLException e) // This line is my problem, Could someone help me how to fix this? Thanks.. 
                {
                  e.printStackTrace();
                }
              }
            });
          }
          catch (SQLException e1)
          {
            onSqlError(e1);
          }
        }
      }, "onWordUpdated").start();
    }
  </code></pre>