title: Show the details from database in jcombobox in GUI
body: <p>Fetch data from database and display in Jcombobox.<br>
  I need to only fetch one column values from daabase name(Combobox).
  The Column in my database are id and Package, i have to fetch package values in jcombobox.                                    </p>
  
  <p>Table in database:  ID  | Package
                      1   | Dadar
                      2   | Matunga
                      3   | Colaba</p>
  
  <pre><code> private void jComboActionPerformed(java.awt.event.ActionEvent evt) {                                       
  
         // ArrayList&lt;Welcome&gt; w = new ArrayList&lt;Welcome&gt;();
          List&lt;alldetails&gt; el;
  alldetails all;
          Connection con;
          PreparedStatement pst;
          ResultSet rs;
          String pack;
  
          try {
             Class.forName("org.apache.derby.jdbc.ClientDriver");
             con=DriverManager.getConnection("jdbc:derby://localhost:1527/ToursandTravel","root","root");
  
             String query=("select Package from COMBOBOX");
             Statement stmt=con.createStatement();
  
             rs=stmt.executeQuery(query);
  
              while(rs.next())
              {
                 // System.out.println("Data "+rs.getString(1)+" "+rs.getString(2));
                 // pack=rs.getString("Id");
                  jCombo.addItem(rs.getString("Package"));
  
              }                
  
          } catch (SQLException ex) {
  
              Logger.getLogger(Welcome.class.getName()).log(Level.SEVERE, null, ex);
  
          } catch (ClassNotFoundException ex) {
              Logger.getLogger(Welcome.class.getName()).log(Level.SEVERE, null, ex);
          }          
  
      }      
  </code></pre>
  
  <p>I am not able to fetch the package column from the database in jcombobox.</p>