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 Spring and the fly likes Anyone know where I can find a short explanation of how to use getJdbcTemplate? 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 » Frameworks » Spring
Bookmark "Anyone know where I can find a short explanation of how to use getJdbcTemplate?" Watch "Anyone know where I can find a short explanation of how to use getJdbcTemplate?" New topic
Author

Anyone know where I can find a short explanation of how to use getJdbcTemplate?

Dave McQueen
Greenhorn

Joined: May 22, 2009
Posts: 29
Hi,
I'm relatively new to Java - even newer to Spring - and I've to use getJdbcTemplate.queryForList to access a database.

It's not complicated code: List returnedSQL = this.getJdbcTemplate().queryForList(sqlQuery);

My problem is that I'm working on a project that requires I use this method and I don't have time to read a spring book. Is there any sites/books/sources that will tell me the minimum I need to get the method to work, as at the moment I'm using trial and error which is hardly efficient - and getting nothing returned.

Please suggest anything other than the api! The APIs seems to be written in a language I just can't fathom. Plus for the jdbcTemplate it's not very clear. The api only tells you about the specific method/class and doesn't take a more holistic/tutorial oriented approach on how to use it - not very helpful for a beginner (which is strange as I assumed the API was for people who don't know that stuff already...)

Any help/patience is appreciated!

P.S The sqlQuery string is a static String and works when used directly on the DB, but not when using queryForList.



Before you criticize someone, try walking a mile in their shoes. That way you'll be a mile away from them. And you'll also have their shoes.
Lalit Bhatt
Ranch Hand

Joined: Dec 27, 2007
Posts: 69
check this http://www.oyejava.com/tiki-index.php?page=Spring


Java-JavaEE Hibernate Spring Spring Roo Web Applications
Venkat Sidh
Ranch Hand

Joined: Sep 30, 2006
Posts: 61
JDBCTemplate is a kind of Connection object obtained from Datasource.

For e.g.,

JdbcTemplate jt = new JdbcTemplate(dataSource);

once you get jt then you can use queryForList() to get List object.

You may find some details here,

http://forums.sun.com/thread.jspa?threadID=5336900
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Anyone know where I can find a short explanation of how to use getJdbcTemplate?
 
Similar Threads
Hibernate SELF LEFT OUTER JOIN
JDBCTemplate QueryForList returns wrong value
Which Method use and how to store data in List after get the data
Hibernate: Call a function that has no return mapping
spring-jdbc doubt