This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC from Spring framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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
internet detective

Joined: May 26, 2003
Posts: 30130

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

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, 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
subject: JDBC from Spring framework
Similar Threads
struts2 or spring?
what is the advantage of spring over struts..
Struts and Other Frameworks change
i want to learn spring framework but not sure about some points
Commons DBUtils -Known issues and performance