JDBC client spring boot

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
IncorrectResultSizeDataAccessException

to fix this we have to get use optional() and return desired result when there is no rows expected from the result set

原文链接:JDBC client spring boot

© 版权声明
THE END
喜欢就支持一下吧
点赞9 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容