-
Feb 13th, 2006, 08:41 PM
#1
what does jdbcTemplate do for us?
when I use JdbcDaoSupport, need I close the resultset,close
the datasource connection everytime I execute some sql?
need I add a transaction to every method in the class?
what does jdbcTemplate do for us and what should we do when using it?
-
Feb 13th, 2006, 08:55 PM
#2
Did you read the documentation?
-
Feb 13th, 2006, 09:57 PM
#3
No, you don't need to close the resultset, connection, etc. What JdbcTemplate does for you is provide various methods for accessing your database without having to worry about catching exceptions or closing your resources.
Basically JdbcTemplate is the basis of straight JDBC in Spring.
Bill
-
Feb 16th, 2006, 09:03 PM
#4

Originally Posted by
trisberg
thank you.
well,I now have read that.there is no need to close the resultset or the connection,but a kind of situation confused me.
I am using JdbcDaoSupport to access my db,which is wrapped with c3p0 datasource;I was trying to invoke a method in my DAO(include result operations) while iterating a resultset in another method.then c3p0 indicated that there's a deadlock! after I added xml-define transaction to these methods,the deadlock disappeared.how to explain this?
also deadlock hints appear while I am using hibernate in an other program.
I cannot find why this keeps happening(I add transaction per request in
the filter in this program using hibernate).
-
Feb 17th, 2006, 08:42 AM
#5
Could you post the method which invokes the JdbcTemplate, including any classes used to read the resultset?
Bill
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules