> For the complete documentation index, see [llms.txt](https://educacion.gitbook.io/programacion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://educacion.gitbook.io/programacion/exercicios-java/ud8-exercicios/dao-con-preparedstatement.md).

# DAO con PreparedStatement

1. Crea unha nova clase DAO para a clase Profesor que traballe con PreparedStatement. Copia os métodos da clase que creaches no exercicio anterior e modificaos axustando os cambios necesarios para funcionar con esta clase:
   1. findAll(): List\<Profesor>
   2. findById(int id): Optional\<Profesor>
   3. insert(Profesor p): int
   4. update(Profesor p): Optional\<Profesor>
   5. remove(int id): boolean
2. Actualiza a clase App para verificar que o novo DAO funciona adecuadamente.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://educacion.gitbook.io/programacion/exercicios-java/ud8-exercicios/dao-con-preparedstatement.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
