Results 1 to 1 of 1
-
What is use of NamedParameterJdbcTemplate in Spring Framework
The NamedParameterJdbcTemplate class has support for programming JDBC statements using named parameters which is generally not supported by other J2ee frameworks.
Following piece of code will make it clearer:
Java Code:// some JDBC-backed DAO class... public int countCustomerBynamee(String firstName) { String sql = "select count(0) from Customer where first_name = :first_name"; NamedParameterJdbcTemplate template = new NamedParameterJdbcTemplate(this.getDataSource()); SqlParameterSource parametersName = new SimpleSqlParameterSource("first_name", firstName); return template.queryForInt(sql, parametersName); }
Similar Threads
-
how to learn spring framework
By m16k2002 in forum Web FrameworksReplies: 6Last Post: 04-06-2009, 03:14 PM -
How to run Queries in Spring framework
By Java Tip in forum Java TipReplies: 0Last Post: 04-01-2008, 11:42 AM -
What is RMI concept in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 10:21 PM -
What is the use of NamedParameterJdbcTemplate in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 09-28-2007, 01:57 PM -
What is weaving in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 09:30 PM
Bookmarks