File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes JDBC from Spring framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC from Spring framework" Watch "JDBC from Spring framework" New topic

JDBC from Spring framework

jay lai
Ranch Hand

Joined: Apr 04, 2002
Posts: 180
I am very new to Spring framework, has anyone know how to write jdbc connection using in Spring framework,
Very thanksful if you can giving some hints or links to some sample code.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

The spring framework site has some sample code. Are you looking for something more specific?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
jay lai
Ranch Hand

Joined: Apr 04, 2002
Posts: 180
Hi Jeane:
Thanks for the hints, if i got return from database more than one record, like a list of record, how do I implemented? For example, select id, first,last,street from table1, it will return like thoudsand of records, I want to loop through all the record and display to the user.
Many thanks for the help
Abhi Vuyyuru

Joined: Mar 10, 2005
Posts: 12
You have to use the JdbcTemplate class query(SQL, params, new MyRowMapper()). Where MyRowMapper is an implementation of the RowMapper, which will map individual rows to objects of your choice as shown below
For a detailed example, of all the classes involved, visit this blog post

Abhi Vuyyuru
I agree. Here's the link:
subject: JDBC from Spring framework
It's not a secret anymore!