title: Java application - How to display all the records from mysql database in netbeans?
body: <p>I`m having trouble with showing all the records from my database... 
  I got database 'library' and table 'books'. 
  Structure of 'members' : id, title, description, author, publisher, yearPublished.</p>
  
  <p>Here is my java code method:</p>
  
  <pre><code>public static void preuzmi() throws ClassNotFoundException, InstantiationException, SQLException, IllegalAccessException{
  Class.forName("com.mysql.jdbc.Driver").newInstance();
  Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/library", "root","");
  
  Statement st = conn.createStatement();
  st.executeQuery("select * from books");
  ResultSet rs = st.getResultSet();
  
  while(rs.next())
              System.out.println(rs.getString("title"));
              System.out.println(rs.getString("description"));
              System.out.println(rs.getString("author"));
              System.out.println(rs.getString("publisher"));
              System.out.println(rs.getString("yearPublished"));
  
          }
  </code></pre>
  
  <p>when i run this method preuzmi(); in main class it shows me only titles from db... <br>
  How can i show other records??? Please help me. THANKS IN ADVANCE!!!</p>