title: dynamically populating a combobox with database data issue
body: <p>I'm trying to populate my combo box with incremental ID's from my ms access database, when I run my program the program runs fine although there is no data inside the combo box and no error given from the console. Can anyone have a look through my code to see how I'm going wrong?</p>
  <pre class="lang-java prettyprint-override"><code>private JComboBox comboBox;
      Connection con;
      PreparedStatement pst;
      ResultSet vResults;
      Statement vStatement;
  
  void updatecombo() throws SQLException { 
          
      try {
          con = connectionz.getConnection();
          vStatement = con.createStatement();
          String vQuery = &quot;SELECT Book_ID FROM books&quot;;
          vResults = vStatement.executeQuery(vQuery);
          while(vResults.next()) {
              comboBox.addItem(vResults.getString(&quot;Book_ID&quot;));
          }
      } catch (Exception e) {
  
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/XOarw.png" rel="nofollow noreferrer">Database</a></p>
  <p><a href="https://i.stack.imgur.com/Rk87C.png" rel="nofollow noreferrer">empty list</a></p>