Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using SPRING hibernate and JDBC templates in the same DAO

 
Gaurav tyagigaurav
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a DAO implementation as:

Now I need to fetch some data using SPRING JDBC template in the same DAO implementation. I am working on a running application and it uses both SPRING hibernate and JDBC template for DAO implementations but never in the same DAO implementor. The usage i have seen for JDBC template in my app is sth. like:

As we cannot extend 2 classes in JAVA so i tried instantiating SimpleJdbcDaoSupport and using it as:

This gives me a null pointer exception at queryForObject line.
Any pointers as to what i might e doing wrong here would be greatly appreciated.

Thanks
Tyagi
 
St├ęphane Beaufort
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java implemenation :



XML declaration :



 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic