I’m trying to use this class but I can’t seem to figure out how to limit the rows returned. Plain JdbcTemplate has a max row and max fetch size setter. Is there any way to get similar functionality out of NamedParameterJdbcTemplate ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
NamedParameterJdbcTemplateexposes its underlyingJdbcTemplateviaNamedParameterJdbcTemplate.getJdbcOperations():Just for information: note that
setMaxRows()shouldn’t be used to set limits for individual queries (becauseNamedParameterJdbcTemplateis intended to be thread-safe, so that you shouldn’t change its state after it have been initialized). Limits for individual queries are usually set by appropriate SQL clauses.