| Topic : Perspectives on Agile Development |
|
|
|
|
||
|
Activity:
1 comments
238 views
last activity : 03 18 2011 06:42:14 +0000
|
||
|
|
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"
Sort by:
Most Recent
Top Rated
Found the article
"What do you get from Spring Jdbc"
interesting ?
Share with your connections and communities
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)
|
|
|
|
|
|
Sponsored Jobs
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... |