Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added solution to the task: #11

Closed

Conversation

nikolasdymchenko7
Copy link

  • established connection to db
  • created init_db.sql file in src/main/resources folder
  • created layer for Book model
  • used injector and Dao annotation
  • called all CRUD methods in Main class

- established connection to db
- created init_db.sql file in src/main/resources folder
- created layer for Book model
- used injector and Dao annotation
- called all CRUD methods in Main class
Comment on lines 49 to 57
Book book = new Book();
if (resultSet.next()) {
String title = resultSet.getString("title");
BigDecimal price = resultSet.getBigDecimal("price");

book.setId(id);
book.setTitle(title);
book.setPrice(price);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets extract Book from resultSet in a separate method

- updated findById method
@nikolasdymchenko7 nikolasdymchenko7 closed this by deleting the head repository Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants