Skip to content

Refactor JDBC DAOs to use JdbcClient where feasible #4897

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Jul 1, 2025

Closes GH-4804

@quaff quaff marked this pull request as draft July 1, 2025 02:18
@quaff quaff marked this pull request as ready for review July 1, 2025 02:52
@quaff
Copy link
Contributor Author

quaff commented Jul 1, 2025

JdbcTemplate is only used for batch update which is not covered by JdbcClient.

@quaff quaff force-pushed the patch-21 branch 2 times, most recently from 8124810 to 789e94d Compare July 1, 2025 03:35
catch (EmptyResultDataAccessException e) {
throw new NoSuchJobException("No job instances were found for job name " + jobName);
}
return getJdbcClient().sql(getQuery(COUNT_JOBS_WITH_NAME)).param("jobName", jobName).query(Long.class).single();
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this throw a NoSuchJobException as before if the result set is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually count statement never generate empty result set.

Closes spring-projectsGH-4804

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor JDBC DAOs to use named parameters instead of positional parameters
2 participants