sethladd
Sep 14th, 2004, 03:53 PM
Hello,
The javadocs say that getObject(String, Object[], Class) will return NULL if the result of the query is NULL.
I am testing for a NULL in my unit tests, and instead of getting NULL from getObject, I get an exception:
org.springframework.dao.IncorrectResultSizeDataAcc essException: Expected single row but found none
at org.springframework.jdbc.core.JdbcTemplate$ObjectR esultSetExtractor.extractData(JdbcTemplate.java:98 2)
at org.springframework.jdbc.core.JdbcTemplate$1.doInP reparedStatement(JdbcTemplate.java:390)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:334)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:375)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:411)
at org.springframework.jdbc.core.JdbcTemplate.queryFo rObject(JdbcTemplate.java:470)
at com.hic.eboss.dao.BrimsDAOJdbcImpl.getBusinessName (BrimsDAOJdbcImpl.java:99)
at
I think this isn't correct, given the javadocs. I am using a CVS build right before 1.1 release (a few days before 1.1)
Am I misinterpreting the javadocs?
Thanks!
Seth
The javadocs say that getObject(String, Object[], Class) will return NULL if the result of the query is NULL.
I am testing for a NULL in my unit tests, and instead of getting NULL from getObject, I get an exception:
org.springframework.dao.IncorrectResultSizeDataAcc essException: Expected single row but found none
at org.springframework.jdbc.core.JdbcTemplate$ObjectR esultSetExtractor.extractData(JdbcTemplate.java:98 2)
at org.springframework.jdbc.core.JdbcTemplate$1.doInP reparedStatement(JdbcTemplate.java:390)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:334)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:375)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:411)
at org.springframework.jdbc.core.JdbcTemplate.queryFo rObject(JdbcTemplate.java:470)
at com.hic.eboss.dao.BrimsDAOJdbcImpl.getBusinessName (BrimsDAOJdbcImpl.java:99)
at
I think this isn't correct, given the javadocs. I am using a CVS build right before 1.1 release (a few days before 1.1)
Am I misinterpreting the javadocs?
Thanks!
Seth