'Spring SimpleJdbcCall and BeanPropertyRowMapper
To get data from database I'm using SimpleJdbcCall
as it is convenient for stored procedures. Along with it I'm using BeanPropertyRowMapper
as the no of fields I have to map from resultset is almost 100.
From Spring docs I could see that BeanPropertyRowMapper
is for convenience and not for performance, as it uses reflection. My stored procedure returns one record and this is to be sent as JSON for front end.
I would want to know:
- Is it correct to use the above mentioned for my use-case or should I switch to a prepared statement and manually mapping from
ResultSet
to POJO? - When the fields to be mapped are less and records are more should I switch from
SimpleJdbcCall
to prepared statement andResultSet
?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|