Create JdbcTemplate Beans
Example code is available on github.com/vaadin-on-grails/jdbc-template.
In this article, we will show how to define beans in order to start working with spring-jdbc.
Step 1
Add dependency to spring-jdbc into BuildConfig.groovy
.
Step 2
We can use JdbcTemplate
to directly execute SQL queries, but if there will be inputs from users, we have to use ?
as a parameter placeholder or rather use NamedParameterJdbcTemplate
to prevent SQL injection.
Last updated