spring-in-action-5-samples: Chapter 3 JDBC problems
-
In chapter 3 there isn’t a mention about adding “IngredientByIdConverter” - without it the app crashes after saving taco design.
-
The code in JdbcTacoRepository.saveTacoInfo() often results in NullPointerException. The solution is to set flag “setReturnGeneratedKeys(true)” on PreparedStatementCreatorFactory object:
PreparedStatementCreatorFactory pscf = new PreparedStatementCreatorFactory(QUERY_SAVE_TACO, Types.VARCHAR, Types.TIMESTAMP);
pscf.setReturnGeneratedKeys(true);
PreparedStatementCreator psc = pscf.newPreparedStatementCreator(Arrays.asList(taco.getName(), new Timestamp(taco.getCreatedAt().getTime())));
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 26
- Comments: 15 (1 by maintainers)
Can someone explain to me why we have created the class Integrientbyidconverter, but do not use its method anywhere?