This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Facing nullpointer exception in Spring JDBC Query.  RSS feed

 
Robinson Francis
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I am facing a null pointer exception while trying to build a Spring JDBC application.

The code that calls the Dao Interface is :



The code for retrieveNodeLocationCount is defined in the Dao class file of XRefUtilityDao.java as below:
public int retrieveNodeLocationCount(String nodeLocation);


The implementation is defined in this file : XRefUtilityDaoImpl.java as :




For some reason the the execution doesn't reach this portion of code called. Every time I pass the parameters to this method in


It returns a Null Pointer exception.

Is it true that the service poid contains tmm_streamyx?--->false


I am still new at this Spring Jdbc, I was wondering why this problem cropped up. Maybe I missed something. Thank you.
 
Csabba Csurja
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

from your posted code I was not able to see what is the statment in MCMBSimplyForFun.java:180 line.
Basically, the getJdbcTemplate.queryForInt doesn't throw NullPointerException.
Are you sure that getJdbcTemplate is not null it self, you can check it, if not then give a try to execute a very simple query which is 100% should run (e.g. without any paramter)

Regards,
Csaba
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!