This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: 32481

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: JDBC from Spring framework
It's not a secret anymore!