every row from the database being one JList item?
<p>I currently have a database that is working well. It displays the text from each column of the database into 5 labels on the app user interface. Some of the time, depending on what the user enters, I want it to display a list of rows from the database, I was thinking of using the JList.</p>

<p>the current code to display to the labels is:</p>

<pre><code>String sqlQuery = "select Column1, Column2, Column3, Column4, Column5 from APP.DATA123 " + 
"where (Column1 = ?) AND (Column2 = ?) AND (Column3 = ?) OR (Column1 = ?) AND (Column2 = ?)";

String abc = jTextField2.getText();
String cba = (String)jComboBox1.getSelectedItem();
String cab = (String)jComboBox2.getSelectedItem();
String data = "jdbc:derby://localhost:1527/sample";
    try (
          Connection conn = DriverManager.getConnection(
          data, "app", "app");
          PreparedStatement st = conn.prepareStatement(sqlQuery))   { 

      Class.forName("org.apache.derby.jdbc.ClientDriver");
      st.setString(1, abc);
      st.setString(2, cba);
      st.setString(3, cab);       
      st.setString(4, cba);
      st.setString(5, cab);
      ResultSet rec = st.executeQuery();
        while (rec.next())  {
          jLabel1.setText(rec.getString("Column1"));
          jLabel2.setText(rec.getString("Column2"));
          jLabel3.setText(rec.getString("Column3"));
          jLabel4.setText(rec.getString("Column4"));
          jLabel5.setText(rec.getString("Column5"));

      }
      st.close();
</code></pre>

<p>Is there an easier way to make it so that if there is more than one row of the database to be displayed to the user, I can make a JList so that all of the columns of one row (and possibly an image but I'll think about that later), are displayed as one item on the JList. So Columns1-5 are one JlistItem, and then columns 1-5 for the next database row are the next JList item etc? </p>

<p>Or another similar way that anyone knows of?</p>

<p>There is not that much text per column only about 5-15 characters. </p>