Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Intermediate
Mar 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 see below:

@Component
public class MyFoo{

   private final JdbcTemplate jdbcTemplate;

   @Autowired
   public MyFoo(JdbcTemplate jdbcTemplate){
            this.jdbcTemplate = jdbcTemplate;
   }
  
  //..
}
Octavia Anghel
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date