aspose file tools*
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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC from Spring framework" Watch "JDBC from Spring framework" New topic
Author

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.
Thanks
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29241
    
139

Jay,
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
Greenhorn

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
Blog: http://java-x.blogspot.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC from Spring framework
 
Similar Threads
Struts and Other Frameworks change
Commons DBUtils -Known issues and performance
what is the advantage of spring over struts..
i want to learn spring framework but not sure about some points
struts2 or spring?