Spring jdbc in spring boot 3.2 and spring framework 6.2 upgraded to fluent style api
which is quite intuitive and easy to understand
but if we are not careful in looking at what the methods are offering when using them we might encounter strange results
example when we need single result from data base query we have this method in jdbc client
single()which returns a single row and if not returning single row , it will throw
IncorrectResultSizeDataAccessExceptionto fix this we have to get use optional() and return desired result when there is no rows expected from the result set
The above is the detailed content of JDBC client spring boot. For more information, please follow other related articles on the PHP Chinese website!