March 10, 2017

Using a JDBC Template

Spring provides a nice abstraction on top of the JDBC API using JdbcTemplate and also provides great transaction management capabilities using annotation-based approach. By using the JdbcTemplate and NamedParameterjdbcTemplate classes, we can take advantage of auto configuration features and eliminate the need to configure beans by ourselves, as you can

Tip: Add Optional Parameters in SQL

You may not know this but you can have optional Parameters in SQL. It took me forever to figure it out. In any case, you can implement an optional parameter by declaring a parameter in your stored procedure and giving it a default value of NULL, then in your WHERE

Optional Parameters in SQL

You may not know this but you can have optional Parameters in SQL. It took me forever to figure it out. In any case, you can implement an optional parameter by declaring a parameter in your stored procedure and giving it a default value of NULL, then in your WHERE