public ArrayList<Prestamos> getById(Prestamos p){
        PreparedStatement ps;
        ArrayList<Prestamos> rows = new ArrayList<>();
        try {
            ps = mycon.prepareStatement("SELECT * FROM Prestamos WHERE id=?");
            ps.setInt(1, p.getId());
            ResultSet rs = ps.executeQuery();
            if(rs!=null){
                try {
                    while(rs.next()){
                        rows.add(
                            new Prestamos(
                                rs.getInt("id"), 
                                rs.getDate("fecha"),
                                rs.getString("estado"),
                                rs.getString("id_libro"),
                                rs.getString("id_usuario")
                            )
                        );
                    }
                } catch (SQLException ex) {
                    Logger.getLogger(Prestamos.class.getName()).
                            log(Level.SEVERE, null, ex);
                }
            }else{
                System.out.println("Total de registros encontrados es: 0");
            }
        } catch (SQLException ex) {
            Logger.getLogger(PrestamosCRUD.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        return rows;
    }