Back Forum Reply New
Hi there,

I have an application which executes a  lot of select statements in one step.
In plain jdbc I would create a prepared statement once and use it in my loop for several times.

Can I do something similar in spring?
If I use JDBCTemplate, PreparedStatementCreator and PreparedStatementSetter. Would spring call the PreparedStatementCreator for every select?

thx
Thomas

Your connection pool (whether app server or standalone) should be performing PreparedStatement caching behind the scenes. Alternatively you could use ConnectionCallback, but then you will need to close the PreparedStatement in a finally block.

Ok thx for your fast help.
Good to know.
¥
Back Forum Reply New