Build your professional network on facebook via our app Go to app
 
<< Prev  13 of 33 in Topic  Next >>
Topic : Perspectives on Agile Development
  Rate : 
Posted in Community :

Tech World |

Java Architect

 
Industry : IT Products Functional Area : Architecture
Activity:  1 comments  238 views  last activity : 03 18 2011 06:42:14 +0000
Share
 
 
 
Spring provides a simplification in handling database access with the
Spring JDBC Template. The Spring JDBC Template has the following
advantages compared with standard JDBC.Spring provides a simplification in handling database access with the
Spring JDBC Template. The Spring JDBC Template has the following
advantages compared with standard JDBC.
Spring provides a simplification in handling database access with the
Spring JDBC Template. The Spring JDBC Template has the following
advantages compared with standard JDBC.
• The Spring JDBC template allows to clean-up the resources
   automatically, e.g. release the database connections,resultsets
  etc..
• The Spring JDBC template converts the standard JDBC
   SQLExceptions into RuntimeExceptions. This allows the
  programmer to react more flexible to the errors. The Spring JDBC
 template converts also the vendor specific error messages into
better understandable error messages.
The Spring JDBC template offers several ways to query the database.
queryForList() returns a list of HashMaps. The name of the column is the
key in the hashmap for the values in the table.
More convenient is the usage of ResultSetExtractor or RowMapper which
allows to translate the SQL result direct into an object
(ResultSetExtractor) or a list of objects (RowMapper).

public List<Person> selectAll() {
JdbcTemplate select = new JdbcTemplate(dataSource);
return select.query("select FIRSTNAME, LASTNAME from PERSON",
new PersonRowMapper());
}
public void create(String firstName, String lastName) {
JdbcTemplate insert = new JdbcTemplate(dataSource);
insert.update("INSERT INTO PERSON (FIRSTNAME, LASTNAME)
VALUES(?,?)",
 
0 comments on "What do you get from Spring Jdbc"
Add your comment on "What do you get from Spring Jdbc"

Rate:
Submit
Leading Training Company
  • Create a confidential Career Profile and Resume/C.V. online
  • Get advice for planning their career and for marketing of experience and skills
  • Maximize awareness of and access to the best career opportunities
Viewers also viewed
Recent Knowledge (69)
Let me share a few issues for TS members. Demarcation of the boundary was initially made with...
 
293 referals 2 comments, 33 views
My friend Rizwan Khan mailed me this interesting draft made by a Pakis journalist.   Written by...
 
427 referals 42 comments, 2675 views
Successful Project Managers   - Characteristics and Skills What are the Characteristics of...
 
203 referals 14 comments, 11875 views
more...  
More From Author
Spring provides a simplification in handling database access with the Spring JDBC Template. The Spring JDBC Template has the following advantages compared with standard JDBC.Spring provides a simplification in handling database access with the...
Alok, you are talking abt two differnent things a) Privacy b) Anonymity. If you were a celebrety privacy is what you miss. If you were a whistle blower anonymity is what you need. Most common privacy issues are unsolicitated email aka spam. The...
Yes, social web browser is here to stay and also rule. What happened to mosiac ?, do u still remember netscape?. FireFox is struggling to keep maintain its market share. (there is no growth is recent years). Google-Chrome entered the market just about...
more...