문제

using spring jdbc I have the update() convenience method for inserting data in the DB.

So I don't need anymore the PreparedStatement stuff??

Is that correct? Or there are situation where I still may need those statements?

도움이 되었습니까?

해결책

You may want to use a PreparedStatement for performance reasons if you had some SQL that was being executed repeatedly. A PreparedStatement also allows for clean parameter substitution within the SQL (rather than doing string concatenation).

Otherwise, for quick and simple insert/update/delete statements, then the convenience JdbcTemplate.update(String) methods may be your best choice.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top