title: get data from a Db display in combobox in java
body: <p>hi everyone i have this code but don't know why it doesn't work!</p>
  
  <pre><code>rset = stmt.executeQuery("SELECT categoryName FROM DB_Library.dbo.categories");
  while (rset.next()) {
      String s = rset.getString("categoryName");
      jComboBox1.addItem(rset.getString(s).trim());
  }
  </code></pre>
  
  <p>don't show me any thing 
  * This code is printing all the items in database:</p>
  
  <pre><code>rset = stmt.executeQuery("select * from DB_Library.dbo.categories");
  while (rset.next()) {
      String s = rset.getString("categoryName");
      System.out.println(s );
  }
  </code></pre>
  
  <p>any help?</p>