private void t5CaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_t5CaretUpdate
        jScrollPane1.setVisible(false);
        jScrollPane2.setVisible(true);
        DefaultTableModel model1 = (DefaultTableModel) jTable2.getModel();
        int bookcode = 0;
        int n = 0;
        String query;
        try 
        {
            bookcode = Integer.parseInt(t5.getText());
        } 
        catch (NumberFormatException e)
        {
            n = 1;
        }

        try {

            if (!(n == 1)) 
            {
                query = "SELECT * FROM books where bookcode like '" + bookcode + "%';";
                ResultSet rs = MyQueries.excQuery(query);
                model1.setRowCount(0);
                while (rs.next()) 
                {
                    int Bookid = rs.getInt("Bookcode");
                    String Bookname = rs.getString("Bookname");
                    String author = rs.getString("author");
                    String genre = rs.getString("genre");
                    model1.addRow(new Object[]{Bookid, Bookname, author, genre});
                }
            } 
            else 
            {
                query = "SELECT * FROM books;";
                ResultSet rs = MyQueries.excQuery(query);
                model1.setRowCount(0);
                while (rs.next()) 
                {
                    int Bookid = rs.getInt("Bookcode");
                    String Bookname = rs.getString("Bookname");
                    String author = rs.getString("author");
                    String genre = rs.getString("genre");
                    model1.addRow(new Object[]{Bookid, Bookname, author, genre});
                }
            }
        } 
        catch (Exception e)
        {
            logger.error("Error Description:", e);
        }
        myClasses.Connections.close(); // Close connection to prevent Database lock
    }//GEN-LAST:event_t5CaretUpdate